Page MenuHomeFreeBSD

More cleanly daemonize quasselcore.

Authored by jhb on Mon, Jan 11, 5:43 PM.


  • Use -c with daemon to change the working directory to / before invoking quasselcore.
  • Use -f with daemon to redirect stdout/stdin/stderr to /dev/null before invoking quasselcore.
Test Plan

I run quasselcore with a real SSL cert managed by LetsEncrypt.
My LE deploy script restarts quasselcore after updating the
cert. The most recent deploy hung because the pipe used for
stdin/stdout/stderr between certbot and my deploy shell script
was still open after the script had exited because the restarted
quasselcore was still using those pipes for its stdin/stdout/stderr.

I modified /usr/local/etc/rc.d/quasselcore to add '-cf' and verified
that 'service restart quasselcore' worked correctly. It also unstuck
my certbot script as the pipes were closed when the previous process
exited. In my case the root bug was caused by the lack of -f, but I
included -c as well it is best practice as well for daemons.

Diff Detail

rP FreeBSD ports repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jhb requested review of this revision.Mon, Jan 11, 5:43 PM

Hi John, looks ok to me. Can I leave it to you to commit this one?

This revision is now accepted and ready to land.Mon, Jan 11, 10:33 PM
This revision was automatically updated to reflect the committed changes.