Fix pidfile is not updated when daemon is started
When the daemon is started at system startup, the pidfile is not updated. This leads to problems when you change the maintenance level because the old daemon is not killed and a new one is started.
Hey @rguca!
Under what circumstances are you encountering issues?
The daemon is already culled in the maintain scripts, and the background processed are stored and stopped (you are storing $$ in your PR instead of $!). The $$ process is stopped once the commands complete.
Hey @rguca!
Under what circumstances are you encountering issues?
The daemon is already culled in the maintain scripts, and the background processed are stored and stopped (you are storing
$$in your PR instead of$!). The$$process is stopped once the commands complete.
Currently deamon pid is stored with $! from maintain function at command execution. At system startup, the function maintain_synchronous is called (defined in plist), which then doesn't write the pidfile. Because the pidfile is not written, the daeman can't be killed by its pid later. $$ is used in the PR in maintain_synchronous, which is called by the daemon itself, so the pidfile is always written.