P
P
Pista2020-11-30 09:08:20
linux
Pista, 2020-11-30 09:08:20

Why can't I change the owner of a file in Centos?

I have an nginx error "Can't open PID file /run/nginx.pid (yet?) after start"
To fix it, you need to change the owner of the file /run/nginx.pid from root to nginx I execute

the command chown -R nginx:nginx /run /nginx.pid
Owner changed, but reverts back to root file owner after nginx reload.
What to do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Volkov, 2020-11-30
@Pista

Came across this mess. One thing is written in the config, another is written in the system unit. Somehow it needs to be more consistent. See what you have on your system /run or /var/run . There you need to fix the file.

G
galaxy, 2020-11-30
@galaxy

I think /run/nginx.pid is a symlink. Change (or delete) the file where it points

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question