I have a bash script that is written in a debian-based distribution (System-V) and I want to run it under CentOS 7. There is a part of the script that runs a command as a daemon like this:
start-stop-daemon --start --pidfile $PIDFILE \
--chdir "$DIR" --startas $PROGRAM --name foo --chuid "$USER" -- $ARGS
And stops the daemon like this:
start-stop-daemon --stop --quiet --pidfile $PID \
--user "$USER" --name foo --retry=TERM/30/KILL/5
My question is how do something equivalent in CentOS 7? Is the daemon
function in /etc/init.d/functions
an alternative?