nginx.service 是这样编写的
[Unit]
Description=A high performance web server and a reverse proxy server
After=network.target network-online.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
PrivateDevices=yes
SyslogLevel=err
ExecStart=/usr/local/nginx/sbin/nginx -g 'pid /usr/local/nginx/logs/nginx.pid; error_log stderr;'
ExecReload=/usr/local/nginx/sbin/nginx -s reload
KillMode=mixed
[Install]
WantedBy=multi-user.target
开机后 Nginx 没有正确启动
$ sudo systemctl status nginx
* nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: timeout) since Sat 2018-08-04 16:26:14 CST; 10s ago
Aug 04 16:24:44 isthnew systemd[1]: Starting A high performance web server and a reverse proxy server...
Aug 04 16:26:14 isthnew systemd[1]: nginx.service: Start operation timed out. Terminating.
Aug 04 16:26:14 isthnew systemd[1]: nginx.service: Failed with result 'timeout'.
Aug 04 16:26:14 isthnew systemd[1]: Failed to start A high performance web server and a reverse proxy server.
系统是 Arch,nginx 版本 1.15.2,貌似很早之前就出现过了,但是没注意,开机后使用 sudo systemctl start nginx
来启动 nginx 一问题都没有。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.