For example with noexec in the home, it changes:
$ rc-service -U foo start
* rc-service: Permission denied
to:
$ rc-service -U foo start
* rc-service: Failed executing '/home/haelwenn/.config/rc/init.d/foo': Permission denied
OpenRC will never call restart(), so scrap the definition in
openrc-run.sh and s6.sh.
reload() caused a weird error message when used without
supervisor=s6, so add proper support for generic reload(),
instantiated for s6, and with a better default error message
for other backends - which can now add support for reload()
down the line.
Also clarify a comment, and add info messages on s6_reload.
generalizing the logic via RC_PATH makes it more flexible, and allows
better usage of multiple unique init directories
we load the config directories in reverse order so that "overriding"
works as intended, i.e., /etc takes preference over /usr
this also makes config directories additive, while init directories are
completely replace each other, config directories are combine, meaning
to change one setting, only that setting needs to be presented in a
higher-priority conf.d
the default path now consists of:
$XDG_CONFIG_DIRS/rc
/etc/rc
/usr/{local,pkg}/etc/rc
/usr/libexec/rc
for user services, $XDG_CONFIG_HOME/rc is added at the top of the config
dirs, $XDG_DATA_HOME at the top of data dirs, and /user is append to all
other paths
additionally, RC_PATH is read from the environment, if it is set, it is
split at every semi-colon and used in place of any default path
XDG_CONFIG_DIRS can be used to prepend the default path, rather than
replacing it whole with RC_PATH.
/etc and /usr/local/etc are provided as compatibility and using the
/rc variants is prefered
/usr/libexec/rc is a new location, meant for system packages to install
init.d to, as many distros would like to have all system packages
install to /usr alone and not touch /etc
/run/openrc is also searched, however it is for now left undocummented,
as the behaviour around it is currently only for internal use, and will
suffer breaking changes if/when made public
Closes: https://github.com/OpenRC/openrc/issues/823
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.)
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.
In order to avoid breaking things for the 3 users who use the old
s6 support, add compatibility.
When command= is empty and a service directory exists in /var/svc.d,
use that service directory instead of creating it from the service
file data.
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
openrc-run has a (hardcoded) 60 seconds timeout, it a service
fails to start/stop within that time, it will be SIGKILL-ed. so
a default 60 seconds fuser_timeout is kind of bad. change it to
20seconds which is somewhat more sensible.
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
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
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>
Added missing options to the completion definition files for the
rc-service, rc-status, and rc-update commands.
(Including --user and -U):
Added status to the cmd option for rc-service.