GrantU
GrantU

Reputation: 6555

Ubuntu Permission Denied Error

I get he following error running this command /etc/init.d/celerybeat start:

chown: changing ownership of `/srv/project/logs': Operation not permitted
chown: changing ownership of `/var/run': Operation not permitted
chown: changing ownership of `/var/run': Operation not permitted
chmod: changing permissions of `/var/run': Operation not permitted
chown: changing ownership of `/srv/project/logs': Operation not permitted
chmod: changing permissions of `/srv/project/logs': Operation not permitted
Starting celerybeat...
ubuntu@ip-10-239-73-129:/etc/default$ LockFailed: [Errno 13] Permission denied: '/var/run/celerybeat.pid'

The user it runs under is 'celery'.

I run this command after to create the user:

adduser --system --no-create-home --disabled-login --disabled-password --group celery

But still get the permission denied error. Why?

Upvotes: 0

Views: 8321

Answers (2)

Harshitha K V
Harshitha K V

Reputation: 446

Add user 'celery' to the sudoers group for this u need to be root user First you can switch user to root

$ su root
$ adduser <username> sudo

Now switch back to 'celery'

$ su celery

Now try and execute the commands with sudo option.

Also to add celery to be the user of that folder you can use chown to change the owner of that folder (as root user)

$ chown -R celery:celery <foldername>

Upvotes: 2

Bobbin Zachariah
Bobbin Zachariah

Reputation: 585

To change permissions and create user you need root permissions, so you should login with root or you can do from normal user with sudo command if the user exists in sudoers file.

Upvotes: 0

Related Questions