{"action":"created","issue":{"url":"https://api.github.com/repos/celery/celery/issues/3018","labels_url":"https://api.github.com/repos/celery/celery/issues/3018/labels{/name}","comments_url":"https://api.github.com/repos/celery/celery/issues/3018/comments","events_url":"https://api.github.com/repos/celery/celery/issues/3018/events","html_url":"https://github.com/celery/celery/issues/3018","id":128218303,"number":3018,"title":"Restart command fails to start celerybeat with generic init.d on Ubuntu 14.04","user":{"login":"pixelchutes","id":352182,"avatar_url":"https://avatars.githubusercontent.com/u/352182?v=3","gravatar_id":"","url":"https://api.github.com/users/pixelchutes","html_url":"https://github.com/pixelchutes","followers_url":"https://api.github.com/users/pixelchutes/followers","following_url":"https://api.github.com/users/pixelchutes/following{/other_user}","gists_url":"https://api.github.com/users/pixelchutes/gists{/gist_id}","starred_url":"https://api.github.com/users/pixelchutes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixelchutes/subscriptions","organizations_url":"https://api.github.com/users/pixelchutes/orgs","repos_url":"https://api.github.com/users/pixelchutes/repos","events_url":"https://api.github.com/users/pixelchutes/events{/privacy}","received_events_url":"https://api.github.com/users/pixelchutes/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/celery/celery/labels/Category:%20Deployment","name":"Category: Deployment","color":"772123"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-22T18:46:36Z","updated_at":"2016-01-22T22:26:51Z","closed_at":null,"body":"I'm not sure why exactly, but the [restart command in generic-init.d/celerybeat](https://github.com/celery/celery/blob/ee27089030bcc3cb3e15bf373491ffe1956620a1/extra/generic-init.d/celerybeat#L300)  would stop the service, but abort before`start_beat` method was ran. \r\n\r\n#### Versions:\r\n`celery-3.1.19 (Cipater)`\r\n```\r\nDescription:\tUbuntu 14.04.3 LTS\r\nRelease:\t14.04\r\nCodename:\ttrusty\r\n```\r\n\r\nBelow is how we ended up fixing the desired behavior in `restart` function: (~Line 303):\r\n\r\n#### Before:\r\n\r\n```sh\r\nstop_beat\r\ncheck_dev_null\r\nstart_beat\r\n```\r\n\r\n#### After:\r\n\r\n```sh\r\nstop_beat && check_dev_null && start_beat\r\n```"},"comment":{"url":"https://api.github.com/repos/celery/celery/issues/comments/174072392","html_url":"https://github.com/celery/celery/issues/3018#issuecomment-174072392","issue_url":"https://api.github.com/repos/celery/celery/issues/3018","id":174072392,"user":{"login":"pixelchutes","id":352182,"avatar_url":"https://avatars.githubusercontent.com/u/352182?v=3","gravatar_id":"","url":"https://api.github.com/users/pixelchutes","html_url":"https://github.com/pixelchutes","followers_url":"https://api.github.com/users/pixelchutes/followers","following_url":"https://api.github.com/users/pixelchutes/following{/other_user}","gists_url":"https://api.github.com/users/pixelchutes/gists{/gist_id}","starred_url":"https://api.github.com/users/pixelchutes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixelchutes/subscriptions","organizations_url":"https://api.github.com/users/pixelchutes/orgs","repos_url":"https://api.github.com/users/pixelchutes/repos","events_url":"https://api.github.com/users/pixelchutes/events{/privacy}","received_events_url":"https://api.github.com/users/pixelchutes/received_events","type":"User","site_admin":false},"created_at":"2016-01-22T22:26:51Z","updated_at":"2016-01-22T22:26:51Z","body":"```python\r\n++ basename service\r\n+ VERSION='service ver. 0.91-ubuntu1'\r\n++ basename service\r\n+ USAGE='Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]'\r\n+ SERVICE=\r\n+ ACTION=\r\n+ SERVICEDIR=/etc/init.d\r\n+ OPTIONS=\r\n+ '[' 2 -eq 0 ']'\r\n+ cd /\r\n+ '[' 2 -gt 0 ']'\r\n+ case \"${1}\" in\r\n+ '[' -z '' -a 2 -eq 1 -a celerybeat = --status-all ']'\r\n+ '[' 2 -eq 2 -a restart = --full-restart ']'\r\n+ '[' -z '' ']'\r\n+ SERVICE=celerybeat\r\n+ shift\r\n+ '[' 1 -gt 0 ']'\r\n+ case \"${1}\" in\r\n+ '[' -z celerybeat -a 1 -eq 1 -a restart = --status-all ']'\r\n+ '[' 1 -eq 2 -a '' = --full-restart ']'\r\n+ '[' -z celerybeat ']'\r\n+ '[' -z '' ']'\r\n+ ACTION=restart\r\n+ shift\r\n+ '[' 0 -gt 0 ']'\r\n+ '[' -r /etc/init/celerybeat.conf ']'\r\n+ '[' -x /etc/init.d/celerybeat ']'\r\n+ exec env -i LANG=en_US.UTF-8 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/ssl/bin:/usr/local/sbin:/usr/local/bin TERM=xterm-256color /etc/init.d/celerybeat restart\r\ncelery init v10.1.\r\nUsing configuration: /etc/default/celeryd, /etc/default/celerybeat\r\nRestarting celery periodic task scheduler\r\nStopping celerybeat...\r\n```\r\n\r\nThere is no subsequent start after the stop event.\r\n\r\nNOTE: This only occurs when `celerybeat` is already running."}}