【问题标题】:How to fix daemon reload access dined issue?如何解决守护程序重新加载访问被拒绝的问题?
【发布时间】:2021-10-15 00:41:21
【问题描述】:

"systemctl 启用 openresty"

我得到了什么

通过 /lib/systemd/systemd-sysv-install 与 SysV 服务脚本同步 openresty.service 的状态。

执行:/lib/systemd/systemd-sysv-install enable openresty

无法重新加载守护进程:访问被拒绝

无法重新加载守护进程:访问被拒绝

无法启用单元:访问被拒绝

这是截图

systemctl status openresty

openresty.service - NGINX HTTP 和反向代理服务器

已加载:已加载(/lib/systemd/system/openresty.service;已启用;供应商预设:已启用)

活动:自 2021 年 8 月 11 日星期三 17:01:13 UTC 以来失败(结果:退出代码); 2 小时 37 分钟前

进程:8875 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=203/EXEC)

8 月 11 日 17:01:13 instance-2 systemd{1]:启动 NGINX HTTP 和反向代理服务器...

8 月 11 日 17:01:13 instance-2 systemd[8875]:openresty.service:执行命令失败:没有这样的文件或目录

8 月 11 日 17:01:13 instance-2 systemd[8875]:openresty.service:执行步骤失败,生成 /usr/sbin/nginx:没有这样的文件或目录

8 月 11 日 17:01:13 instance-2 systemd(1]: openresty.service: 控制进程退出,code=exited, status=203/EXEC

8 月 11 日 17:01:13 instance-2 systemd(1]: openresty.service: 失败,结果为“exit-code”。

8 月 11 日 17:01:13 instance-2 systemd(1]: 无法启动 NGINX HTTP 和反向代理服务器。

This is screenshot

journalctl -u openresty

-- 日志从 2021 年 8 月 10 日星期二 17:42:07 UTC 开始,到 2021 年 8 月 11 日星期三 19:20:05 UTC 结束。 --

8 月 10 日 19:14:22 instance-2 systemd(1]: 启动 OpenResty 应用平台...

8 月 10 日 19:14:22 instance-2 systemd(1]:启动 OpenResty 应用平台。

8 月 10 日 22:00:10 instance-2 systemd(1]: 停止 OpenResty 应用平台...

8 月 10 日 22:00:10 instance-2 systemd(1]: openresty.service: 成功。

8 月 10 日 22:00:10 instance-2 systemd(1]: 停止了 OpenResty 应用程序平台。

8 月 10 日 22:00:10 instance-2 systemd(1]: 启动 OpenResty 应用平台...

8 月 10 日 22:00:10 instance-2 nginx[4012]: nginx: [emerg] 指令“server_name”未由“;”终止在 /etc/openresty/sites-enabled/m.facebook.com.conf:7

8 月 10 日 22:00:10 instance-2 nginx[4012]: nginx: 配置文件 /usr/local/openresty/nginx/conf/nginx.conf 测试失败

8 月 10 日 22:00:10 instance-2 systemd(1]: openresty.service: 控制进程退出,code=exited, status=1/FAILURE

8 月 10 日 22:00:10 instance-2 systemd(1]: openresty.service: 失败,结果为“exit-code”。

8 月 10 日 22:00:10 instance-2 systemd(1]: 无法启动 OpenResty 应用平台。

8 月 10 日 22:01:15 instance-2 systemd(1]: 启动 OpenResty 应用平台...

8 月 10 日 22:01:15 instance-2 nginx[4034]: nginx: [emerg] 指令“server_name”未由“;”终止在 /etc/openresty/sites-enabled/m.facebook.com.conf:7

8 月 10 日 22:01:15 instance-2 nginx[4034]: nginx: 配置文件 /usr/local/openresty/nginx/conf/nginx. conf 测试失败

8 月 10 日 22:01:15 instance-2 systemd(1]: openresty.service: 控制进程退出,code=exited, status=1/FAILURE

8 月 10 日 22:01:15 instance-2 systemd(1]: openresty.service: 失败,结果为“exit-code”。

8 月 10 日 22:01:15 instance-2 systemd(1]: 无法启动 OpenResty 应用平台。

8 月 11 日 17:01:13 instance-2 systemd(1]: 启动 NGINX HTTP 和反向代理服务器...

8 月 11 日 17:01:13 instance-2 systemd[8875]:openresty.service:执行命令失败:没有这样的文件或目录

8 月 11 日 17:01:13 instance-2 systemd[8875]: openresty.service: 在步骤 EXEC spawning / usr /sbin / nginx 时失败:没有这样的文件或目录

8 月 11 日 17:01:13 instance-2 systemd(1]: openresty.service: 控制进程退出,code=exited, status=203/EXEC

8 月 11 日 17:01:13 instance-2 systemd(1]: openresty.service: 失败,结果为“exit-code”。

8 月 11 日 17:01:13 instance-2 systemd(1]: 无法启动 NGINX HTTP 和反向代理服务器。

This is screenshot

【问题讨论】:

  • 尝试以 root 身份,或使用 sudo。 sudo systemctl enable openresty.
  • @SYN 好的,谢谢你能不能也请你帮我解决这个sudo systemctl start openresty openresty.service 的工作失败,因为控制过程以错误代码退出。详见“systemctl status openresty.service”和“journalctl -xe”。
  • 您能否编辑您的初始帖子,包括systemctl status openrestyjournalctl -u openresty(或journalctl -xe)的输出?
  • @SYN 完成,我已编辑
  • 上面写着Failed at step EXEC spawning /usr/sbin/nginx: No such file or directory。以前的日志提到配置错误... nginx 仍然安装吗?你的 nginx 配置有效吗?

标签: nginx debian openresty


【解决方案1】:

听起来您正在尝试从非特权帐户启用服务。

如果系统配置为允许,您也许可以使用 sudo:

sudo systemctl enable openresty

如果没有,您必须以 root 身份登录:

su
[enter your root password]
systemctl enable openresty

【讨论】:

    猜你喜欢
    • 2013-09-06
    • 1970-01-01
    • 2018-08-31
    • 2012-06-01
    • 2021-09-14
    • 2017-08-09
    • 2012-11-27
    • 2018-03-27
    • 1970-01-01
    相关资源
    最近更新 更多