busybox's and toybox's sysctl do not have --system
currently we simply check for return success, this if fragile as
failures unrelated to "missing --system" would also trigger the manually
loading path, alternatively we could have some hard knob, though an
automated detection method would be preferred
Fixes: https://github.com/OpenRC/openrc/issues/947
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
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
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.
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.
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.
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.
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
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
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
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
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.
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
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
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
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.
- 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
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.
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>
- 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.