AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1042526
Accepted
TornaxO7
TornaxO7
Asked: 2020-11-15 03:44:51 +0800 CST2020-11-15 03:44:51 +0800 CST 2020-11-15 03:44:51 +0800 CST

open() "/run/nginx.pid" 失败 (13: Permission denied)

  • 772

目前,我已经设置了一个 nextcloud 服务器,nginx并使用sudo systemctl enable nginx.service. 当我重新启动时,我收到一条抱怨代理服务器的错误消息,如果我查看一下sudo systemctl status nginx.service,我会收到以下信息:

nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/etc/systemd/system/nginx.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sat 2020-11-14 12:20:55 CET; 16min ago

Nov 14 12:20:55 TORNAX-ARCH systemd[1]: Starting A high performance web server and a reverse proxy server...
Nov 14 12:20:55 TORNAX-ARCH nginx[473]: 2020/11/14 12:20:55 [warn] 473#473: could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_si>
Nov 14 12:20:55 TORNAX-ARCH nginx[473]: 2020/11/14 12:20:55 [emerg] 473#473: bind() to 192.168.178.35:443 failed (99: Unknown error)
Nov 14 12:20:55 TORNAX-ARCH systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Nov 14 12:20:55 TORNAX-ARCH systemd[1]: nginx.service: Failed with result 'exit-code'.
Nov 14 12:20:55 TORNAX-ARCH systemd[1]: Failed to start A high performance web server and a reverse proxy server.

如果我跑步nginx -t,我会得到这个:

2020/11/14 12:37:40 [warn] 68391#68391: could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2020/11/14 12:37:40 [emerg] 68391#68391: open() "/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed

当我正在寻找有关此open() "/run/nginx.pid" failed (13: Permission denied)错误的解决方案时,我只能获得 docker + nginx 的解决方案,例如这些帖子:

  • https://stackoverflow.com/questions/57427162/nginx-emerg-open-var-run-nginx-pid-failed-13-permission-denied
  • https://stackoverflow.com/questions/64393237/nginx-emerg-open-run-nginx-pid-failed-13-permission-denied
  • https://dockerquestions.com/2020/10/16/nginx-emerg-open-run-nginx-pid-failed-13-permission-denied/
  • https://github.com/Wonderfall/dockerfiles/issues/40

它在手动重新启动服务后工作,sudo systemctl restart nginx.service但我仍然open() "/run/nginx.pid" failed (13: Permission denied)在运行时得到nginx -t。

我做错了什么或者我能做些什么来解决这个问题?

permissions nginx arch-linux nextcloud
  • 2 2 个回答
  • 20007 Views

2 个回答

  • Voted
  1. alexandru
    2020-12-09T08:05:24+08:002020-12-09T08:05:24+08:00

    sudo nginx -t

    这个评论应该是一个答案。

    Run nginx -t as root. This is a red herring. – Michael Hampton Nov 15 at 0:27

    • 7
  2. Best Answer
    Michael S
    2021-06-03T10:25:01+08:002021-06-03T10:25:01+08:00

    这可能是一个错误。“这种行为是一个已知的错误,由 nginx 和 systemd 之间的竞争条件引起。Systemd 期望在 nginx 有时间创建它之前填充 PID 文件。” https://www.cloudinsidr.com/content/heres-fix-nginx-error-failed-read-pid-file-linux/

    • 2

相关问题

  • 如何在 Exchange 2007 中设置资源邮箱日历的忙/闲权限?

  • 共享文件夹中某些文件的访问被拒绝错误

  • Bash 脚本:要求脚本以 root 身份运行(或使用 sudo)

  • 如何授予用户安装 Windows 服务的能力?

  • 限制用户向电子邮件地址发送电子邮件

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve