summaryrefslogtreecommitdiff
path: root/init.d
AgeCommit message (Collapse)Author
2025-11-18s6-svscanboot: launch s6-svscan with notify=fd:4Laurent Bercot
Now that the bug that made it fail is fixed, use the start-stop-daemon readiness notification mechanism when launching s6-svscan. (We do not run s6-svscan under supervise-daemon because that would needlessly lengthen the supervision chain. Yo dawg, we heard you like supervisors.)
2025-11-13init.d/*: check if RC_CACHEDIR is writtableAnna (navi) Figueiredo Gomes
Bug: https://github.com/OpenRC/openrc/issues/890 Fixes: https://github.com/OpenRC/openrc/issues/936
2025-11-13init.d/localmount: remove sourcing of rc-mount.shAnna (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-10-30init.d/net-online: pass -n to ping to avoid rDNS overheadSam James
e21b01b97e84f81589f52e087d2b2ac53f0bf144 fixed one of the issues mentioned in Gentoo bug #650584 but not the other one. `ping` without `-n` will perform reverse DNS lookups for IPs which we don't want, as it introduces a delay and confuses the calculation we make. Bug: https://bugs.gentoo.org/650584 Bug: https://github.com/OpenRC/openrc/issues/353
2025-09-03sysfs: mount tracefs explicitly if availableLauri Tirkkonen
for rationale, see https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9ba817fb7c6afd3c86a6d4c3b822924b87ef0348
2025-08-23init.d/net-online: Support tun/tap devicesJohn R. Graham
Added a single line that allows tun/tap interfaces to be properly handled. It turns out that /sys/class/net/${interface}/operstate shows "unknown" for tun/tap interfaces, not "up", which is the value that net-online depends on. So tun/tap interfaces need minor special handling.
2025-08-23init.d/net-online: Minor bug fixJohn R. Graham
The code that reads interface status from the sysfs had stderr redirection in the wrong order, which means that, in the event that the interface does not yet exist, the read will display an error message that was meant to be suppressed.
2025-08-23init.d/*: add -wsl depend keywordsAnna (navi) Figueiredo Gomes
by the list in !871 it mostly seemed to match docker and similar, so for now let's add -wsl to all services that have -docker Closes: https://github.com/OpenRC/openrc/issues/871
2025-05-27build: drop 'os' option and use host_machine.system()Anna (navi) Figueiredo Gomes
to specify a different host, meson's machine files should be used instead.
2025-05-27build: drop GNU-kFreeBSD supportAnna (navi) Figueiredo Gomes
Debian GNU-kFreeBSD was the only known distribution, and they dropped support for GNU-kFreeBSD back in 2023[1] 1: https://lists.debian.org/debian-devel/2023/07/msg00176.html
2025-05-20supervisor=s6: fix indentation, add more paranoid hardeningLaurent Bercot
2025-05-20supervisor=s6 support: additional small bugfixesLaurent Bercot
2025-05-20supervisor=s6: rework supportLaurent Bercot
This commit modernizes the support for the supervisor=s6 backend. It reworks how the supervision tree is started and how the services are defined. The s6-svscan service now runs its own catch-all logger, logging to $RC_SVCDIR/s6-logs. A service defining supervisor=s6 now has an automatic "need" dependency to s6-svscan. A service directory will be automatically built from the information in the service file, under the $RC_SVCDIR/s6-services repository. These service directories are cached until the service file (or config) changes. So, services don't need to provide their service directories themselves anymore; they still can, but they'll need to do the s6-sv[un]link thing themselves. The documentation has been updated. Anna, please add yourself to the AUTHORS file, because it is ridiculous that I am now in it and you are not.
2025-04-29build: fix installation of getty symlinksWilliam Hubbs
The getty symlinks are installed both in the init.d directory and the default runlevel directory. This makes the getty installation consistent with the rest of the runlevel setup.
2025-04-29build: install functions.sh init.d symlink with mesonWilliam Hubbs
2025-04-29Revert "init.d/user: add a respawn_delay value"Anna (navi) Figueiredo Gomes
this reverts commit 1146ee616c55751db4350c389757862d67e7a1b0. safe-guarding against new defaults in /etc/rc.conf isn't really great in retrospect, so ideally we improve the defaults so that rc.conf presets are not needed. Bug: https://github.com/OpenRC/openrc/issues/852
2025-04-27init.d/user: add a respawn_delay valueAnna (navi) Figueiredo Gomes
Fixes: https://github.com/OpenRC/openrc/issues/852
2025-04-26init.d/user: use longer respawn periodAnna (navi) Figueiredo Gomes
some setups could actually take more than a second to fail 3 times "in a row" Bug: https://bugs.gentoo.org/952108
2025-04-25init.d/meson.build: install agetty as a relative symlinkAnna (navi) Figueiredo Gomes
it's the standard for symlinks to exist as relative pointers. absolute symlinks at install time also triggers an issue with meson[1] 1: https://github.com/mesonbuild/meson/issues/12253 Fixes: https://github.com/OpenRC/openrc/issues/847
2025-04-15init.d/user: quit fast if it's failing rapidlyNRK
Ref: https://bugs.gentoo.org/952108 Ref: https://github.com/OpenRC/openrc/issues/817
2025-04-15sysfs: mount /sys/fs/bpf if availableLauri Tirkkonen
eg. cilium expects /sys/fs/bpf to be mounted. systemd mounts it here as well.
2025-04-13init.d/user: use notify (fixes 3527c772)NRK
2025-04-09install agetty symlinks via mesonNRK
also adds a 'agetty' array option so that user can specify which symlinks to create. Closes: https://github.com/OpenRC/openrc/pull/355
2025-04-05cgroups: set (irrelenvant) device string to cgroup2Pablo Correa Gómez
Just a cosmetic change with no real changes, more than the visual impact when running mount
2025-04-04openrc-user: use ready=fd to notify the sesion when user 'boot' finishedAnna (navi) Figueiredo Gomes
this means users can reliably do checks like `--ifstarted status` from profile scripts at login, and be sure certain environment variables can be set as the listening services for them will already be running if they're on the boot user runlevel
2025-04-04init.d/savecache, sh/openrc-user.sh: cache init.d and conf.d from svcdir as wellAnna (navi) Figueiredo Gomes
this avoids regenerating the deptree cache for services in there, if they're always created
2025-04-04init.d/savecache: remove softlevel from save listAnna (navi) Figueiredo Gomes
there's no point in saving a copy of softlevel, it'll always be the runlevel 'savecache' is running under, and it'll always be re-written to "sysinit" early at boot
2025-04-04openrc: don't use libexec for data cacheAnna (navi) Figueiredo Gomes
instead, move caches to /var/cache/openrc. If /var is not mounted, cache will not be used and the deptree would be regenerated user services use ${XDG_CACHE_HOME}/rc, defaulting to ~/.cache Closes: https://github.com/OpenRC/openrc/issues/339
2025-03-08init.d/*: Quote the argument of ":" commandsUlrich Müller
This avoids globbing, see: https://www.shellcheck.net/wiki/SC2223
2025-02-27openrc-user, pam_openrc, init.d/user: Add autostart for user services.Anna (navi) Figueiredo Gomes
2024-07-28init.d/root.in: fix eend messageAnna (navi) Figueiredo Gomes
2024-07-28init.d/root: add support for 'r?shared' fstab option on /Dominique Martinet
containers on linux might require filesystems to be mounted with different propagation than the kernel default of 'private': by setting 'shared' in fstab for / options, one can now make the fs hierarchy shared. Note we use 'rshared' to make other existing mounts shared as well because the setting is contagious and it seemed more logical to behave as if the setting was set on / immediately (and thus inherited by other mounts) This fixes #525.
2024-07-25Podman detectionKanako the Gay
2024-01-12enable confd cgroups mount optionsForza-tng
This fixes #684.
2023-11-14init.d/cgroups.in: fix inconsistency between mount_cgroups and mount_cgroupsSam James
965de92b37cbe8d8670f6cc956e1d10677551e19 changed the default cgroup mode which exposes an issue in init.d/cgroups.in. While mount_cgroups defaults to 'unified' if rc_cgroup_mode is unset, cgroup2_controllers has no default and therefore has a mismatch with the logic in mount_cgroups. The two should be consistent so the flow makes sense, as mount_cgroups expects a certain path to be taken in cgroup2_controllers. Make cgroup2_controllers default to 'unified' if rc_cgroup_mode is unset, just like mount_cgroups. Bug: https://bugs.gentoo.org/916964 Thanks-to: acab@digitalfuture.it
2023-10-10change default RC_CGROUP_MODE to unifiedWilliam Hubbs
This improves resource management by assigning services to individual cgroups. X-Gentoo-Bug: https://bugs.gentoo.org/914972
2023-03-07init.d/rc.conf: make unicode default to yesWilliam Hubbs
2022-12-08make the location of the swclock reference file configurableWilliam Hubbs
This fixes #565.
2022-09-07Avoid warning on grep 3.8 in hwclockStefan Linke
Starting with grep version 3.8, the hwclock init script logs warnings about stray backslashes: > hwclock | * Setting system clock using the hardware clock [UTC] ... > hwclock |grep: warning: stray \ before - > hwclock |grep: warning: stray \ before - This is caused by the check for existence of the `--noadjfile` argument in function `get_noadjfile()`. Replacing the affected logic with an explicit argument denoting the pattern as such resolves the issue. Fixes #548
2022-09-04init.d/root: don't remount swapSören Tempel
While refactoring the changes proposed in #533 a minor error was introduced were the root service will now attempt to remount swap. This will fail with the error message `mountinfo: 'swap' is not a mountpoint`. This fixes #546
2022-09-02init.d/root: also remount / with options provided in /etc/fstabSören Tempel
Without this commit, the root OpenRC service remounts all mounted filesystems (except /) with the options defined in /etc/fstab via fstabinfo. It is presently unclear to me why / was excluded from remounting in 497ff7ee41168d863971efb52e2ca6b42f765832 and unfortunately neither the commit nor the associated Bugzilla issue [1] provides further information on this. At Alpine, our initramfs does currently not remount / with all options defined in /etc/fstab [2]. As part of the discussion on the Alpine side of things we wondered why OpenRC does not remount / since this would be the easier solution for us. For this reason, this commit changes the behavior of the OpenRC root services accordingly to also remount / with the options defined in /etc/fstab. [1]: https://bugs.gentoo.org/401573 [2]: https://gitlab.alpinelinux.org/alpine/mkinitfs/-/merge_requests/103 This fixes #533.
2022-06-28remove trailing spaceWilliam Hubbs
2022-06-27modules.in: always return 0, make loading more verboseWilliam Hubbs
2022-06-08clean up hostname service scriptWilliam Hubbs
- use _ throw-away variable to get rid of a shellcheck warning - remove tests for /etc/hostname and just try to read it - drop reference to bash HOSTNAME variable. - make source of host name more accurate X-Gentoo-Bug: 850577 X-Gentoo-Bug-URL: https://bugs.gentoo.org/850577
2022-04-30multiple spelling and typo fixesJosh Soref
This fixes #516.
2022-04-21seedrng: use posix positional params to avoid space splittingJason A. Donenfeld
The value of ${seed_dir} may have spaces in it, making the current argument string building method unsafe. Instead, use positional parameters to pass these arguments safely.
2022-04-20seedrng: incorporate various improvementsJason A. Donenfeld
There have been a number of subtle improvements and cleanups to seedrng, including using openat and locking the directory fd instead of a separate lock file. Also various stylistic cleanups. This fixes #519. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2022-04-06migrate fully to meson build systemWilliam Hubbs
- drop old build system - move shared include and source files to common directory - drop "rc-" prefix from shared include and source files - move executable-specific code to individual directories under src - adjust top-level .gitignore file for new build system This closes #489.
2022-03-31init.d/seedrng.in: fix rc_yesno typoSam James
This fixes #512.