Here's my situation whenever I reboot:
$ systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
nginx.service loaded failed failed A high performance web server and a reverse proxy server
...
$ nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2014/01/18 05:44:47 [emerg] 254#0: open() "/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed
$ cd /run
$ ls -al | grep nginx
$ sudo systemctl start nginx
$ ls -al | grep nginx
-rw-r--r-- 1 root root 4 Jan 18 06:27 nginx.pid
I don't understand how nginx.pid
could have incorrect permissions before it's even created, or what one would do to resolve that.
I'm using Arch and I've seen similar issues relating to chroot-jail, but I did not install nginx in a chroot.
cd
'd to/run
andgrep
ed for the file. As you can see above, the pid file isn't created until I manually start nginx. I tried changing the permissions, but they're reset after each reboot. – Ryne Everett Jan 18 '14 at 19:58sudo
. I see you doingnginx -t
(not sure of the whole systemctl functioning) but it might be worth check as what user is nginx trying to start because pid is owned by root. – APZ Jan 18 '14 at 20:28