fix(rc): clear stale colibri socket before start (Sam & Codex)
Remove stale socket and pidfiles in prestart while rc.d still has root privileges. This handles live USB repair cases where a previous corrupt/root-started daemon left /var/run/colibri/colibri.sock owned by root, causing the colibri user to fail unlink with EPERM and bind with EADDRINUSE.\n\nChecks: sh -n packaging/freebsd/colibri_daemon.in; git diff --check.
This commit is contained in:
parent
7d239053ed
commit
07e4660a95
1 changed files with 5 additions and 0 deletions
|
|
@ -84,6 +84,11 @@ colibri_daemon_prestart()
|
|||
install -d -o "${colibri_daemon_user}" -g "${colibri_daemon_group}" -m 0750 \
|
||||
"$(/usr/bin/dirname "${colibri_daemon_logfile}")"
|
||||
|
||||
# Remove stale runtime files while rc.d is still root. The daemon process
|
||||
# runs as colibri and cannot unlink a stale socket left behind by a prior
|
||||
# root/corrupt manual start.
|
||||
rm -f "${colibri_daemon_socket}" "${pidfile}" "${supervisor_pidfile}"
|
||||
|
||||
# Config is passed to the child via the environment.
|
||||
export COLIBRI_DAEMON_DATA_DIR="${colibri_daemon_data_dir}"
|
||||
export COLIBRI_DAEMON_SOCKET="${colibri_daemon_socket}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue