Page MenuHomeFreeBSD

More cleanly daemonize quasselcore.
ClosedPublic

Authored by jhb on Jan 11 2021, 5:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 30 2024, 3:39 PM
Unknown Object (File)
Dec 23 2023, 1:43 AM
Unknown Object (File)
Nov 26 2023, 8:16 PM
Unknown Object (File)
Nov 22 2023, 2:53 AM
Unknown Object (File)
Nov 22 2023, 2:53 AM
Unknown Object (File)
Nov 22 2023, 2:53 AM
Unknown Object (File)
Nov 22 2023, 1:02 AM
Unknown Object (File)
Oct 28 2023, 8:29 AM
Subscribers

Details

Summary
  • 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

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Jan 11 2021, 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.Jan 11 2021, 10:33 PM
This revision was automatically updated to reflect the committed changes.