Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 80116  / 1 Year ago, mon, march 27, 2023, 10:16:44

If a program requires write permission how should I set it with chown? Specifically, what would program foo's permissions be to solve this error?



failed to create pid file '/var/run/bar.pid': Permission denied

More From » permissions

 Answers
2

If you have a program foo trying to create/write to a file, the permissions of the foo binary don't matter, but the user it's running as makes all the difference.



In this case, foo is trying to write to /var/run, which is owned by root and only writable by root.



So you would have to run the program as sudo foo for it to create that PID file. Please consider the security implications of allowing a program to run as root before you do it...


[#36252] Tuesday, March 28, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
singerrupt

Total Points: 435
Total Questions: 111
Total Answers: 109

Location: Angola
Member since Tue, May 5, 2020
4 Years ago
singerrupt questions
;