summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2025-11-19*-daemon: always call setgroups, defaulting to count = 0origin/setgroups-zeroAnna (navi) Figueiredo Gomes
services started by init don't get any supplementary groups, but anything started from a shell would inherit the groups, causing inconsistent behaviour we can either clear all groups, or always initalize root's groups. since other init systems does not initialize anything, including us at boot, let's just always clear them unconditionally
2025-11-18start-stop-daemon.c: fix failure case on --notify fd:4Laurent Bercot
When the created notified pipe (often on 4) is the same number as the notification fd target, dup2() does not clear the FD_CLOEXEC flag, so the fd gets closed right when exec'ing the daemon, reporting readiness failure. Fix this by explicitly testing for the case and clearing the flag when necessary. Note that this happens because of a call to close_range() right before the test. close_range() is the real problem, it should never be used and this bug is a perfect illustration of why; but getting rid of close_range() is a much more invasive change that I don't want to commit to right now, especially since navi's plan is to eventually deprecate start-stop-daemon.
2025-11-13openrc-run: error check posix_spawn_file_actions_* callsAnna (navi) Figueiredo Gomes
2025-11-13checkpath: allow -W with -f, -d, -pAnna (navi) Figueiredo Gomes
check for writtability after the open attempt, and still creating the file beforehand if it doesn't exist
2025-11-13checkpath: don't break the format stringAnna (navi) Figueiredo Gomes
2025-11-13checkpath: use goto errAnna (navi) Figueiredo Gomes
2025-11-13checkpath: use mkfifoatAnna (navi) Figueiredo Gomes
2025-11-13checkpath: factor openat call out of switchAnna (navi) Figueiredo Gomes
2025-11-13checkpath: split out create code into a functionAnna (navi) Figueiredo Gomes
2025-11-13checkpath: pass TRUNC to initial opening flags if usedAnna (navi) Figueiredo Gomes
2025-11-13checkpath: unify default mode checkAnna (navi) Figueiredo Gomes
2025-11-13checkpath: formatting: check conditions in-placeAnna (navi) Figueiredo Gomes
2025-11-13checkpath: remove unnecessary memsetAnna (navi) Figueiredo Gomes
2025-11-13checkpath: unify umask call when creating $pathAnna (navi) Figueiredo Gomes
2025-11-13checkpath: simplify open flagsAnna (navi) Figueiredo Gomes
O_CLOEXEC and O_NOFOLLOW are posix for a while now, no need to check.
2025-11-13checkpath: use result of basename_c(path) directlyAnna (navi) Figueiredo Gomes
path is not modified in that function, and basename_c already returns a null-terminated string, so there's no need to allocate a copy
2025-11-13checkpath: formatting: unify variable declarationsAnna (navi) Figueiredo Gomes
2025-11-13checkpath: use switch over if-else chainAnna (navi) Figueiredo Gomes
2025-11-13checkpath: use early returnsAnna (navi) Figueiredo Gomes
2025-11-13checkpath: formatting: use single quotes over backtickAnna (navi) Figueiredo Gomes
2025-11-13checkpath: formatting: remove odd line breaksAnna (navi) Figueiredo Gomes
2025-11-13shared/misc: close exclusive fd on exec_serviceAnna (navi) Figueiredo Gomes
2025-11-12openrc-run: fix path to openrc-run.shAnna (navi) Figueiredo Gomes
2025-11-12openrc-user: use /bin/sh if user's login shell is not in /etc/shellsAnna (navi) Figueiredo Gomes
Bug: https://github.com/OpenRC/openrc/issues/940
2025-11-12openrc-run: formatting changesAnna (navi) Figueiredo Gomes
odd line breaks were annoying me a lot
2025-11-12shared/misc.c: use posix_spawn in exec_serviceAnna (navi) Figueiredo Gomes
2025-11-12openrc-run: use posix_spawnAnna (navi) Figueiredo Gomes
makes the code simpler, since we don't have to care about signals and forking directly, and faster.
2025-11-12openrc-run: cleanup svc_execAnna (navi) Figueiredo Gomes
2025-11-12do_unmount: add parallel unmountingNRK
this turns mouninfo into a multicall binary which can also do parallel unmounting. most mountinfo code is unchanged; only notable change is find_mounts() now returns the number of mounts found and also takes the "process" function as an argument; so that is_mounted() can be implemented on top of it. do_unmount mostly follows the logic of previous code. some notable changes: - do_unmount is now "lazy" when it comes to retrying failed unmounts. it will greedily keep running unmount as long as it can before it looks at the "waiting" queue. - it will check if the mountpoint is still mounted or not when umount returns non-zero exit code. this is due to the fact that multiple umount calls might race to unmount a shared mount. so if umount fails _but_ the mountpoint is no longer mounted, we assume success. - do_unmount used to fail if fuser did not find any pids using the mount. the new code tries one more time; the rationale being that there's a gap between the umount call and the fuser call, and so whatever was using the mount before might have stopped using it now and so it's worth another attempt. Fixes: https://github.com/OpenRC/openrc/issues/662 Closes: https://github.com/OpenRC/openrc/pull/698
2025-11-08supervise-daemon: reverse meaning of respawn-delay value warningAster Boese
Currently, the warning states that the user should increase the value of respawn-delay, even though the code checks if respawn-delay is more than the cap and period value. Thus, the correct warning is to recommend the opposite. Fixes https://github.com/OpenRC/openrc/issues/939
2025-10-18Expand minimum padding to 26 in rc-updateTomas Fabrizio Orsi
Originally, rc-update displayed service names with a padding of 20 characters. However, some services like "systemd-tmpfiles-setup-dev" required longer padding and caused the displayed service table to be missaligned. Therefore, padding is increased to 26 characters. Bug: https://github.com/OpenRC/openrc/issues/937 Signed-off-by: Tomas Fabrizio Orsi <torsi@fi.uba.ar>
2025-09-20librc: use xasprintf in rc_service_descriptionAnna (navi) Figueiredo Gomes
2025-09-20librc: use xasprintf in rc_service_extra_commandsAnna (navi) Figueiredo Gomes
2025-09-20librc: use statically sized array over constant xmalloc in file_regexAnna (navi) Figueiredo Gomes
2025-09-20librc: remove d->d_name, not pathname, in rm_dir loopAnna (navi) Figueiredo Gomes
Fixes: https://bugs.gentoo.org/963052
2025-09-16librc-depend: fix rc.conf.d/*.conf mtime not checkedSertonix
2025-09-10openrc: disable --override and krunlevel for user servicesAnna (navi) Figueiredo Gomes
we don't support it for user sessions yet, so this will silence some unnecessary errors when the system instance is using krunlevels
2025-09-07pam_openrc: don't unlock non-initialized lockfd.Anna (navi) Figueiredo Gomes
this passed by unnoticed during a refactor, where svc_lock was moved down. defer would've prevented this.
2025-09-07librc, mountinfo: fix build headers for netbsdSetiQyu
2025-09-04pam_openrc: avoid clobbering errno when checking for rc_autostart_userAnna (navi) Figueiredo Gomes
2025-09-03pam_openrc: respect PAM_SILENTAnna (navi) Figueiredo Gomes
2025-09-03pam_openrc: add rc_autostart_user to rc.confAnna (navi) Figueiredo Gomes
allows system administrators to disable autostarting without changing pam configuration files.
2025-08-28openrc-run: simplify main with a command tableAnna (navi) Figueiredo Gomes
2025-08-28src/openrc-run: remove arg2 from svc_execAnna (navi) Figueiredo Gomes
svc_exec is always called with `command, NULL`, the second argument is never actually used.
2025-08-23librc: add wsl detectionAnna (navi) Figueiredo Gomes
probing procfs is the recommeded method on github[1], as well as the one used by systemd[2], though we also do two additional checks mentioned by Kangie in https://github.com/OpenRC/openrc/issues/871. 1: https://github.com/microsoft/WSL/issues/423#issuecomment-221627364 2: https://github.com/systemd/systemd/blob/main/src/basic/virt.c#L658
2025-07-24recognise alacritty as a color terminaldakkar
2025-07-12librc: allow user services to add boot servicesAnna (navi) Figueiredo Gomes
Fixes: https://github.com/OpenRC/openrc/issues/880
2025-07-12openrc-run: remove timeout from start/stopAnna (navi) Figueiredo Gomes
4d8a5c4 added the timeout logic from svc_wait into svc_exec, with the goal of avoiding stalling the boot process should a service hang, however we failed to mention the change in NEWS, and some critical services like postgres rely on inifinite timeout for `stop()`. this logic was also sharing the `timeout` keyword from `depend()`, which is not very clean let's revert the timeout logic, and properly re-introduce it later, with effort put into making sure no issues happen. Bug: https://github.com/OpenRC/openrc/issues/896
2025-07-08librc-depend: clear dirfds unconditionallyAnna (navi) Figueiredo Gomes
init.sh creates the directory, which means we never actually do it here early at boot Fixes: 22bfd3a Fixes: https://github.com/OpenRC/openrc/pull/893
2025-07-05openrc-run: unset signal_pipe[1] before closing itDominique Martinet
In the unlikely case the service timed out and the child process exited just as we closed the file descriptor, the signal handler could try writing to an invalid fd. There is no other thread around so this is harmless but might as well unset the variable first.