Move volatile PID files under run
Debian Trixie package bundle / packages (push) Successful in 20m30s
Debian Trixie package bundle / packages (push) Successful in 20m30s
This commit is contained in:
@@ -24,6 +24,9 @@ set(XPL_DEFAULT_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/bongo)
|
||||
set(BONGO_STATE_DIR /var/lib/bongo CACHE PATH
|
||||
"Persistent Bongo state directory")
|
||||
set(XPL_DEFAULT_STATE_DIR ${BONGO_STATE_DIR})
|
||||
set(BONGO_RUNTIME_DIR /run/bongo CACHE PATH
|
||||
"Volatile Bongo runtime directory")
|
||||
set(XPL_DEFAULT_RUNTIME_DIR ${BONGO_RUNTIME_DIR})
|
||||
|
||||
set(XPL_DEFAULT_BIN_DIR ${CMAKE_INSTALL_PREFIX}/sbin)
|
||||
set(XPL_DEFAULT_LIB_DIR ${CMAKE_INSTALL_PREFIX}/${LIB_DIR_NAME})
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
|
||||
#cmakedefine XPL_DEFAULT_DATA_DIR "@XPL_DEFAULT_DATA_DIR@"
|
||||
#cmakedefine XPL_DEFAULT_STATE_DIR "@XPL_DEFAULT_STATE_DIR@"
|
||||
#cmakedefine XPL_DEFAULT_RUNTIME_DIR "@XPL_DEFAULT_RUNTIME_DIR@"
|
||||
|
||||
#cmakedefine XPL_DEFAULT_BIN_DIR "@XPL_DEFAULT_BIN_DIR@"
|
||||
#cmakedefine XPL_DEFAULT_LIB_DIR "@XPL_DEFAULT_LIB_DIR@"
|
||||
|
||||
@@ -22,8 +22,9 @@ configuration under `/etc`, not `/usr/etc`.
|
||||
| `/var/lib/bongo/spool` | Queue spool. |
|
||||
| `/var/lib/bongo/dbf` | Account database, random seed, protocol parameters, and runtime credentials. |
|
||||
| `/var/lib/bongo/web` | Web session, task, and identity databases. |
|
||||
| `/var/lib/bongo/work` | Runtime work area. |
|
||||
| `/var/lib/bongo/work` | Persistent diagnostics, traces, and recovery data. |
|
||||
| `/var/lib/bongo/cache` | Regenerable caches. |
|
||||
| `/run/bongo` | Volatile PID and agent recovery files. |
|
||||
| `/usr/sbin` | Server agents and administration programs. |
|
||||
| `/usr/libexec/bongo` | Private administration helpers. |
|
||||
| `/usr/share/bongo` | Web assets, providers, zone snapshot, templates, and examples. |
|
||||
@@ -50,7 +51,8 @@ cmake -S . -B build \
|
||||
-DCMAKE_INSTALL_PREFIX=/opt/bongo \
|
||||
-DSYSCONF_INSTALL_DIR=/etc \
|
||||
-DBONGO_CONFIG_DIR=/etc/bongo \
|
||||
-DBONGO_STATE_DIR=/srv/bongo
|
||||
-DBONGO_STATE_DIR=/srv/bongo \
|
||||
-DBONGO_RUNTIME_DIR=/run/bongo
|
||||
```
|
||||
|
||||
Absolute paths are compiled into agents and generated service/configuration
|
||||
@@ -59,10 +61,10 @@ or supplying matching package overrides.
|
||||
|
||||
## Runtime directories
|
||||
|
||||
Packages should not ship a populated `/var/run` tree. systemd-tmpfiles or the
|
||||
service script creates volatile directories at boot. Persistent empty
|
||||
directories below `/var/lib/bongo` are created during setup or package
|
||||
installation with the appropriate owner.
|
||||
Packages should not ship a populated `/var/run` or `/run` tree.
|
||||
systemd-tmpfiles or the service script creates `/run/bongo` at boot.
|
||||
Persistent empty directories below `/var/lib/bongo` are created during setup
|
||||
or package installation with the appropriate owner.
|
||||
|
||||
TLS, DKIM, DMARC and SRS material below `/etc/bongo` must be included in backup
|
||||
and permission reviews. ACME deployments may point configuration at paths
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
# ****************************************************************************/
|
||||
|
||||
d @XPL_DEFAULT_STATE_DIR@ 0750 @BONGO_USER@ @BONGO_USER@ -
|
||||
d @XPL_DEFAULT_RUNTIME_DIR@ 0750 @BONGO_USER@ @BONGO_USER@ -
|
||||
d @XPL_DEFAULT_DBF_DIR@ 0750 @BONGO_USER@ @BONGO_USER@ -
|
||||
d @XPL_DEFAULT_WORK_DIR@ 0750 @BONGO_USER@ @BONGO_USER@ -
|
||||
d @XPL_DEFAULT_CACHE_DIR@ 0750 @BONGO_USER@ @BONGO_USER@ -
|
||||
|
||||
@@ -697,7 +697,7 @@ ServerInfo(void)
|
||||
snprintf(hostname, sizeof(hostname), "unknown");
|
||||
hostname[sizeof(hostname) - 1] = '\0';
|
||||
snprintf(pid_path, sizeof(pid_path), "%s/bongomanager.pid",
|
||||
XPL_DEFAULT_WORK_DIR);
|
||||
XPL_DEFAULT_RUNTIME_DIR);
|
||||
pidfile = fopen(pid_path, "r");
|
||||
if (pidfile) {
|
||||
if (fscanf(pidfile, "%ld", &pid) != 1)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <libintl.h>
|
||||
#define _(x) gettext(x)
|
||||
|
||||
#define LOCKFILE XPL_DEFAULT_WORK_DIR "/bongomanager.pid"
|
||||
#define LOCKFILE XPL_DEFAULT_RUNTIME_DIR "/bongomanager.pid"
|
||||
|
||||
/* Don't restart agents if they crash n times within m seconds of each other */
|
||||
#define MAX_CRASHES 3
|
||||
@@ -2016,9 +2016,9 @@ main(int argc, char **argv)
|
||||
fprintf(stderr, _("bongo-manager: run with -s to stop an existing process, or -f to ignore the existing pidfile.\n"));
|
||||
} else if (errno == EPERM) {
|
||||
fprintf(stderr, _("bongo-manager: %s user does not have permission to create a lock file in %s\n"),
|
||||
MsgGetUnprivilegedUser(), XPL_DEFAULT_WORK_DIR);
|
||||
MsgGetUnprivilegedUser(), XPL_DEFAULT_RUNTIME_DIR);
|
||||
} else {
|
||||
fprintf(stderr, _("bongo-manager: could not create lock file in %s : %s\n"), XPL_DEFAULT_WORK_DIR, strerror(errno));
|
||||
fprintf(stderr, _("bongo-manager: could not create lock file in %s : %s\n"), XPL_DEFAULT_RUNTIME_DIR, strerror(errno));
|
||||
}
|
||||
|
||||
goto err_handler;
|
||||
|
||||
@@ -700,7 +700,7 @@ MsgInit(void)
|
||||
void
|
||||
MsgRecoveryFlagFile(char *agent, char *buffer, size_t buffer_len)
|
||||
{
|
||||
snprintf(buffer, buffer_len - 1, "%s/%s.pid", XPL_DEFAULT_WORK_DIR, agent);
|
||||
snprintf(buffer, buffer_len - 1, "%s/%s.pid", XPL_DEFAULT_RUNTIME_DIR, agent);
|
||||
}
|
||||
|
||||
EXPORT BOOL
|
||||
|
||||
@@ -14,6 +14,7 @@ DEFAULT_NLS_DIR = '@XPL_DEFAULT_NLS_DIR@'
|
||||
DEFAULT_SCMS_DIR = '@XPL_DEFAULT_SCMS_DIR@'
|
||||
DEFAULT_SPOOL_DIR = '@XPL_DEFAULT_SPOOL_DIR@'
|
||||
DEFAULT_STATE_DIR = '@XPL_DEFAULT_STATE_DIR@'
|
||||
DEFAULT_RUNTIME_DIR = '@XPL_DEFAULT_RUNTIME_DIR@'
|
||||
DEFAULT_STORE_SYSTEM_DIR = '@XPL_DEFAULT_STORE_SYSTEM_DIR@'
|
||||
DEFAULT_WORK_DIR = '@XPL_DEFAULT_WORK_DIR@'
|
||||
DEFAULT_WORKER_DIR = '@XPL_DEFAULT_WORKER_DIR@'
|
||||
|
||||
@@ -39,11 +39,11 @@ class ConfigSlapd:
|
||||
self.root = "\\com\\example\\admin"
|
||||
self.password = adminRootpw
|
||||
self.slapdPid = None
|
||||
self.slapdPidFile = Xpl.DEFAULT_WORK_DIR + "/bongo-slapd.pid"
|
||||
self.slapdPidFile = Xpl.DEFAULT_RUNTIME_DIR + "/bongo-slapd.pid"
|
||||
|
||||
if not os.path.exists(Xpl.DEFAULT_WORK_DIR):
|
||||
os.makedirs(Xpl.DEFAULT_WORK_DIR)
|
||||
Privs.Chown(Xpl.DEFAULT_WORK_DIR)
|
||||
if not os.path.exists(Xpl.DEFAULT_RUNTIME_DIR):
|
||||
os.makedirs(Xpl.DEFAULT_RUNTIME_DIR)
|
||||
Privs.Chown(Xpl.DEFAULT_RUNTIME_DIR)
|
||||
|
||||
def slapdRunning(self, port):
|
||||
s = socket.socket()
|
||||
|
||||
Reference in New Issue
Block a user