[Citadel Development] Re: Write server PID to citadel.lock in addition to locking it.
So here's what is on my mind regarding this. Suggestions are welcome. `/var/run` is a good place to put the PID file, which as previously mentioned is also the lock file. Mounting the same database from two different instances of `citserver` would be A Bad Thing. (Even though I'm still freaking amazed at how stable the database has become once we switched to the mmap-backed environment ... I still can't make it go corrupt no matter how hard I try.) On a regular machine, or in a jail, `/var/run` is in the right place, and does the right thing. In a container ... `/var/run` will not be in the same persistent volume as the database. That means someone could accidentally start up two containers that have different `/var/run` but the same `/usr/local/citadel/data` with catastrophic results. I'm tossing around a couple of ideas: * Writing the pid file to both $ctdldir/citadel.lock *and* /var/run/citserver.pid * Making /var/run/citserver.pid a symbolic link to $ctdldir/citadel.lock I really don't want to make the containerized version harder to use.
[Citadel Development] Re: Write server PID to citadel.lock in addition to locking it.
Whoa, what font is that ?!! I am aware that `/var/run` is the conventional location, and may yet move it there. Doing so would, however, prevent multiple instances of Citadel Server from running on the same host. There were definitely people doing that in the past, but I wonder if nowadays that is still a thing, with everyone now having virtual machines and jails and containers and all sorts of other ways to isolate multiple workloads on the same machine.
[Citadel Development] Re: Write server PID to citadel.lock in addition to locking it.
PID files are usually in /var/run and are suffixed with "pid" as seen in the attached screenshot of my /var/run Mon Sep 18 2023 10:21:10 EDT from rss <> Subject: Write server PID to citadel.lock in addition to locking it. This will be useful for systems like FreeBSD that need to know a PID to monitor.