Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLUnable to start service nginx-log, prevents nginx from starting as a service (Read 60 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLUnable to start service nginx-log, prevents nginx from starting as a service

Trying to set up Pydio on my server using nginx, but I can't start nginx.
When I run:

Code: [Select]
sudo s6-rc -u change nginx

the command just hangs. When I press Ctrl-C the following message shows:

Code: [Select]
s6-rc: warning: unable to start service nginx-log: command crashed with signal 2

So that leads me to believe for some reason nginx-log cannot start?
I checked the directory:

Code: [Select]
/var/log/nginx/

but the folder only has one file called "access.log" which is empty. I suppose this is expected since s6 isnt able to start the error logging at all.

I also tried:

Code: [Select]
sudo nginx -t

which gave the following output:

Code: [Select]
2020/09/12 16:23:25 [warn] 2262#2262: 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
nginx: configuration file /etc/nginx/nginx.conf test is successful

so that all seems fine

I also just tried running nginx manually and that does work. I was able to access the nginx default page, so it seems like its just some kind of wierd issue with s6 and nginx logging.

No idea where to go from here to fix this.

Tried using nginx and nginx-mainline but both have the same issue.

Re: Unable to start service nginx-log, prevents nginx from starting as a service

Reply #1
Sorry about that. It's a permissions issue. A lot of daemons just got a *-log service added recently (including nginix) so it's possible this may happen to a few daemons. The s6-log daemon runs as the s6log user/group not root and tries to log itself in the /var/log/nginx directory. Since you used the nginx service before, you already have that directory created and it's owned by root. s6-log tries to write to it, but constantly fails hence why you get the hang. The fix is to just change the folder to be owned by s6log (or you could also just delete it if you don't care about the contents). The access.log within the nginx folder is still owned by root so no worries there.

Re: Unable to start service nginx-log, prevents nginx from starting as a service

Reply #2
Perfect, that fixed it. Thanks!  :D

 

Re: Unable to start service nginx-log, prevents nginx from starting as a service

Reply #3
Np, could you mark it as solved?

Oh nevermind it is hah.