So FreeBSD's rc system sends a SIGTERM when you do "doas service citserver stop".  This should run the same code that cleanly shuts down citserver when you do a ".ATN y" from the text client.  All the BSDs opurrate this way, and since it is a standard way of doing things, SMF (Solaris/OpenSolaris/Illumos) also supports this method of daemon shutdown.

Probably also a good idea to handle SIGQUIT and SIGKILL this way (for the odd platform that says these aren't untrappable).

If FreeBSD's rc system can't get a process to exit cleanly after a short period of time, it will SIGKILL, and that's most likely lead to database corruption on my installation.

Thu Aug 31 2023 23:39:48 EDT from IGnatius T Foobar Subject: Re: Removed background and restart from citserver.
citserver should exit cleanly when it receives a SIGINT, SIGQUIT, or
SIGKILL.

This may be why using FreeBSD's rc system caused badness on my
system.

And it so happens that FreeBSD is the reason I pulled that section of code out.

This is an opportunity to remove all of the "clever" stuff and really focus on portable, standard code.

I do feel that there's no longer any reason why a server program should have to do the work to put itself into the background. The operating system's supervisor program should be doing that. I'm sure I'll be learning more about how FreeBSD's rc system works. Seems like it's held pretty closely to Unix System III. That's fine, because I've always hated the System V init scripts.

I did release what we've got so far as Citadel 991, with some of the FreeBSD changes in place, but I'm going to keep poking at it until it builds cleanly without needing help.

Also I have an ACloudGuru account paid for by my employer and that lets me stand up cloud sandboxes for testing things. I'm going to start using that for an occasional build test, I think. The only problem is that the sandboxes automatically self-destruct after four hours, so it's not useful for much more than testing. Right now I've got the latest Easy Install build running on a Scamazon instance, with a 30-thread load test pounding away at it. I figure it's better to abuse their SSDs than mine.

 

Reply via email to