Repository navigation
Replace unmaintained daemonize with daemonize-next and default the daemon user to nobody - #145
Open
MohibShaikh wants to merge 1 commit into
Open
MohibShaikh wants to merge 1 commit into
MohibShaikh wants to merge 1 commit into
Conversation
daemonize 0.5 is unmaintained (RUSTSEC-2025-0069). daemonize-next keeps its API, so only the dependency line changes, and it drops root's supplementary groups when switching user and reports a failed start in the launcher. The default daemon user and group were "onbody", which does not exist, so with no daemon_user configured the user lookup failed after the fork, the error was only logged, and the server kept running as root. Default to nobody, take the group from the user when daemon_group is empty, and return the error when daemonizing fails.
This was referenced Oct 26, 2026
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
daemonize0.5 is unmaintained (RUSTSEC-2025-0069). This switches todaemonize-next, which keeps the same API, and fixes the default daemon user.Changes
Cargo.toml:daemonize = { package = "daemonize-next", version = "0.1" }. No call sites change.server.rs: the defaultdaemon_useranddaemon_groupwere"onbody", which doesn't exist. The default user is nownobody, and whendaemon_groupis empty no group is set, so the daemon gets the user's primary group (nogroupon Debian, where there is nonobodygroup).server.rs: when daemonizing fails, return the error instead of logging it and starting the server anyway.Why
With daemonize 0.5, a failed user lookup or pid file lock happens after the fork. The error was only logged, and the server kept running as root. 0.5 also never calls
setgroups, so a daemon dropped todaemon_userkept root's supplementary groups.Proof
rvault server --configwithdaemon = true, run as root in arust:latestcontainer where root is also in groups 4 and 27, then reading/proc/<pid>/statusof the daemon:daemon_user = "nobody",daemon_group = "nogroup"daemon_user/daemon_groupdaemon_user = "no-such-user"failed to start the daemon: unable to resolve user name to user id "no-such-user"unable to lock pid fileand keeps starting until the port bind failsunable to lock pid file /tmp/rvw/rusty_vault.pid: ... (another process holds the lock; is the daemon already running?)CI on a fork, the full workflow, for this branch and for unmodified main on the same day.
unix-default-testfails atcargo clippy -- -D warningson this branch (Ubuntu and macOS) and on main (Ubuntu; main's macOS job was cancelled by fail-fast), with the same 20 errors from newer stable lints (15redundant reference in format!and 5 others), none inserver.rs. Every step before Clippy passes on this branch on both OSes, includingcargo testandcargo test --features sync_handler(292 + 19 + 1 each). The Tongsuo, MySQL, sqlx-MySQL and Windows jobs pass on both branches.