>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  
  
 Perfect.  That's exactly the desired behavior, and it will be "even more
that way" now. 
  
 I have to go examine other BSD rc scripts, but I'm guessing they simply do
"&" to put a process in the background, and then they keep track of the pid
so they can SIGTERM it later. 
  
 SIGINT and SIGTERM are handled by running the very same shutdown code that
the server's "DOWN" command runs (which is what the text client's "<.A>dmin
<T>erminate-server <N>ow" command executes).  Unmount the databases cleanly,
then exit(0) to GTFO. 
  
 What's new, however, is that the database "environment" is now on mmap+disk
instead of just in-memory.  I don't know how we went for so many years without
knowing that we had that wrong.  This accomplishes two things: 
  
 1. The server no longer goes SIGSEGV when we try to close the environment

 2. The database never, ever shows up as corrupted when we restart it 
  
 In other words, the damn journaling system works correctly now.  The funny
thing is, it used to work fine even in its old form, so I don't know what's
changed in the last few versions of Berkeley DB. 
  
 And here we are, with a BDB implementation that's now rock solid, as a result
of a two month long development effort intended to get us *off* BDB. 
  
 But with that done, I'm gonna focus on FreeBSD for a while. 
 

Reply via email to