0đź‘Ť
Based on Chris’s answer, the solution how to restart supervisord program without sudo permission:
You have to edit supervisord.conf to change socket permissions (in my case located at /etc/supervisor/supervisord.conf]
[unix_http_server]
file=/var/run//supervisor.sock ; (the path to the socket file)
chmod=0766 ; sockef file mode (default 0700)
Then you have to make sure, that user who is written in config file is user who will restart program:
[program:projectx_celerybeat]
; Set full path to celery program if using virtualenv
command=/path_to_project_root/env/bin/celery beat -A main -s /path_to_project_root/celerybeat-schedule --loglevel=INFO
; remove the -A myapp argument if you are not using an app instance
directory=/home/xxx/project_root/celery_root/
user=YOUR_USER
numprocs=1
stdout_logfile=/path_to_log/beat.log
stderr_logfile=/path_to_log/beat.log
autostart=true
autorestart=true
startsecs=10
Then this command runned by YOUR_USER shoud work:
supervisorctl [stop/start/restart] [program_name]
1đź‘Ť
I haven’t tried this specifically with celery beat, but I seem to recall it worked for me on another program. You can configure supervisor to run the program under a particular user and then I believe you can use the following command without requiring sudo if it is run from that user:
supervisorctl [stop/start/restart] [program_name]
. See the “user” parameter here:
http://supervisord.org/configuration.html#program-x-section-settings
- [Answer]-Django help me raise validation error
- [Answer]-Django use ORM to get range of a particular element
- [Answer]-I get error MultiValueDictKeyError if I dont upload all 3 filefields in my django form