linux - Ubuntu 权限被拒绝错误

标签 linux ubuntu celery

我在运行此命令 /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'

它运行的用户是“celery”。

我在创建用户后运行此命令:

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

但是还是报权限被拒绝的错误。为什么?

最佳答案

将用户 'celery' 添加到 sudoers 组,为此你需要是 root 用户 首先你可以将用户切换到 root

$ su root
$ adduser <username> sudo

现在切换回“ celery ”

$ su celery

现在尝试使用 sudo 选项执行命令。

还可以将 celery 添加为该文件夹的用户,您可以使用 chown 更改该文件夹的所有者(作为 root 用户)

$ chown -R celery:celery <foldername>

关于linux - Ubuntu 权限被拒绝错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16833268/

相关文章:

python - 防止重复的 celery 记录

linux - 在 linux 中不使用 shell 更改目录?

linux - CPAN 在 ubuntu 上给出各种错误

linux - 为 Bash 中的每个主机名添加前缀

reactjs - 问题在网站的子路由上托管 react 应用程序 - 多个网站一个 IP 地址 NGINX

PHP $_POST 在远程提交时为空

django - Celery (Django + Redis) 任务失败 : "No connection could be made because the target machine actively refused it"

python - 无法看到在 celery-rabbitMQ 组合中执行的任务的输出消息

regex - 如果一行以 = 结尾,则将下一行附加到它 (sed)

c# - .NET Core : error: libc. musl-x86_64.so.1:无法打开共享对象文件:没有这样的文件或目录