If in /etc/default/celeryd I set:
CELERYD_USER="www-data"
CELERYD_GROUP="www-data"
The celeryd service fails to start when I run:
sudo service celeryd start
I get the following error:
Job for celeryd.service failed because the control process exited with error code. See "systemctl status celeryd.service
" and "journalctl -xe" for details.
Getting the service status (showing the key lines):
Apr 27 13:33:23 rtubuntu su[12448]: pam_unix(su:session): session opened for user www-data by (uid=0
Apr 27 13:33:23 rtubuntu celeryd[12428]: This account is currently not available.
Apr 27 13:33:23 rtubuntu systemd[1]: celeryd.service: Control process exited, code=exited status=1
From researching I think this is from the case that www-data has no shell, from:
more /etc/passwd | grep www-data
Returns:
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
I think running sudo -s -u www-data is different than running as a service as this uses the current shell with the rights of the chosen user.
Do you see what I mean? Have you added a shell to www-data for running a celeryd service?
Thanks,
Ben
On Thursday, 27 April 2017 12:30:03 UTC+1, Ed McDonagh wrote:
> Hi Ben
>
>
> I start the celery daemon as the www-data user - why can't you do this?
>
>
> Interactively, I do this by becoming www-data:
> sudo -s -u www-data
>
>
>
> Does that help?
>
>
> Ed
>
>
> On 27 April 2017 at 08:49, Ben wrote:
> Hi Ed (and others!),
>
>
>
> I've set up celery as a daemon which seems to be working well. One query I have though is how certain folder permissions should be set for a production set up using Apache. As per the documentation the static and media directories are owned by www-data. However, following the celery documentation:
http://docs.celeryproject.org/en/latest/userguide/daemonizing.html#daemonizing it recommends using an unprivileged user for running the celery worker process. This worker will then need read/write access to /media/celery and /media/exports. In this case I made a "celery" user for this purpose. However, it appears www-root will also need read/write access to these directories e.g. for deleting exported files. The simple answer might be to make celery run as www-data, but this user has no shell so can't execute the python -m celery worker command.
>
>
>
> Any thoughts on the best way to set up other than giving read/write access to all users to these directories?
>
>
>
> Thanks,
>
>
>
> Ben
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "OpenREM" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to
openrem+u...@googlegroups.com.