init-script-template
init-script-template copied to clipboard
Cannot stop script without sudo
I am having a problem stopping a script that I am running using the user
option. I configured the permissions on some necessary directories to be able to start the service properly, but when I try to stop it, I get the following message:
kill: Operation not permitted
After some investigation I found that the PID stored for the init script is the one for the sudo -u <user> <cmd>
command, and there is a separate one for the actual running script. I started the service and I cannot kill the process using kill <pid>
using both the pid for the sudo -u
command (stored in /var/run/<cmd>.pid
) as the desired user. Any ideas?