From dd09676f88f8adf383a6e6d60801e884e99c89a7 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Tue, 15 Sep 2015 13:59:48 -0400 Subject: [PATCH] Hide celery user --- airtime_mvc/application/services/CeleryService.php | 3 +-- airtime_mvc/application/services/SoundcloudService.php | 1 + python_apps/airtime-celery/setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/services/CeleryService.php b/airtime_mvc/application/services/CeleryService.php index 8e9091290..b05692410 100644 --- a/airtime_mvc/application/services/CeleryService.php +++ b/airtime_mvc/application/services/CeleryService.php @@ -77,8 +77,7 @@ class CeleryService { $c = self::_setupCeleryExchange($config, self::$_CELERY_RESULTS_EXCHANGE, $queue); $message = $c->getAsyncResultMessage($task->getDbName(), $task->getDbTaskId()); - // If the message isn't ready yet (Celery hasn't finished the task), - // only throw an exception if the message has timed out. + // If the message isn't ready yet (Celery hasn't finished the task), throw an exception. if ($message == FALSE) { if (self::_checkMessageTimeout($task)) { // If the task times out, mark it as failed. We don't want to remove the diff --git a/airtime_mvc/application/services/SoundcloudService.php b/airtime_mvc/application/services/SoundcloudService.php index 8e946375e..101cb4499 100644 --- a/airtime_mvc/application/services/SoundcloudService.php +++ b/airtime_mvc/application/services/SoundcloudService.php @@ -19,6 +19,7 @@ class SoundcloudService extends ThirdPartyCeleryService implements OAuth2 { */ protected static $_SERVICE_NAME = SOUNDCLOUD_SERVICE_NAME; // SoundCloud service name constant from constants.php + // TODO: Make these constants /** * @var string exchange name for SoundCloud tasks */ diff --git a/python_apps/airtime-celery/setup.py b/python_apps/airtime-celery/setup.py index 1f26c373e..58f92cdf0 100644 --- a/python_apps/airtime-celery/setup.py +++ b/python_apps/airtime-celery/setup.py @@ -35,7 +35,7 @@ def postinst(): os.chmod('/var/log/airtime', 0775) # Create the Celery user - call(['adduser', '--no-create-home', '--home', '/var/lib/celery', '--gecos', '', '--disabled-login', 'celery']) + call(['adduser', '--no-create-home', '--gecos', '', '--disabled-login', '--firstuid', '1', '--lastuid', '999', 'celery']) # Add celery to the www-data group call(['usermod', '-G', 'www-data', '-a', 'celery'])