To answer the question you guess that you have, is that --pidfile
is used to check whether the daemon process is already running. On RHEL (and derivates) the daemon
function won't write the pidfile.
In the case that the program stays in the foreground it has to be explicitly sent to the background by appending &
to the command and the pid has to be fetched afterwards. $!
is not usable when using daemon
.