| Age | Commit message (Collapse) | Author |
|
Less error prone and more flexible, and allows for better support of
multiple script dirs.
|
|
the current code uses a bunch of signal unsafe functions inside
the signal handlers. this gets those code outside using
self-pipe trick so that there's no more issues.
also save and restore errno inside signal handlers in order to
avoid clobbering errno for the calling code.
the SIGCHLD handler is still seperate since we want to reap
zombies as soon as possible.
Ref: https://github.com/OpenRC/openrc/issues/589
|
|
this sets us up for being able to use "self-pipe trick" to handle
signals safely.
|
|
Closes: https://github.com/OpenRC/openrc/issues/706
|
|
it's generally advisable to use `_exit` rather than `exit` from
forked child to avoid triggering things like `atexit` handlers
and whatnot.
|
|
|
|
The syscall expects unsigned integers.
|
|
This avoids globbing, see: https://www.shellcheck.net/wiki/SC2223
|
|
|
|
|
|
distros might set a different directory for pam security modules, this
allows them to specify a value, defaults to $prefix/$libdir/security
|
|
Closes: https://github.com/OpenRC/openrc/issues/781
|
|
|
|
|
|
|
|
|
|
Signed-off-by: doasu <me@doasu.dev>
|
|
the 'a' article should be used before 'usual', as the word starts with a
consonant (/ˈjuːʒʊəl/ -> j)
Signed-off-by: doasu <me@doasu.dev>
|
|
Signed-off-by: doasu <me@doasu.dev>
|
|
|
|
Passing the wrong variable over, we were trying to load /etc, not
/etc/rc.conf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is necessary for services in rc_svcdir() to be executed properly.
We then set RC_SVCNAME to applet, taken directly from argv[1], then we
call realpath on argv[1]. This allow us to execute `service` even after
chdir(), even if argv[1] is a relative path, and allows openrc-run.sh to
find conf.d since RC_SERVICE is derived from `service`, not applet.
|
|
This allows the instantiation of scripts at runtime, so we can, for
example, create user.<username> for user-services without writing
anything to /etc (or any permanent storage, for that matter).
|
|
|
|
|
|
|
|
|
|
Adds two helper functions, and allows scripts to wait until services are
ready before proceeding with it's dependees by setting `ready=fd:<num>`,
where <num> is the file descriptor the daemon should write a new line to.
|
|
|
|
Not implemented, should not have been commited yet.
|
|
we're timing out when starting dependencies, but not when starting the
service itself, which leads to boot stalling if any service directly
from a runlevel stalls to start.
|
|
|
|
|
|
We need to handle --user before calling any functions that interact with
librc.
|
|
Some binaries required to have their `atexit(cleanup)` calls moved to
after argument parsing, since setting user mode also adds an atexit
call, and cleaning up user paths should only happen after the cleanup of
the application is done, thus needs to be set first.
|
|
Some services might expect to be in home, and may behave unexpectedly
for the user, e.g. any program started via dbus, and this matches
systemd-user behaviour.
|
|
|
|
Those variables are required for user scripts to work properly.
|
|
Add a new function to librc, `rc_usrconfdir()`, whick returns the
location where user-made rc.conf exists.
The user-made configuration is loaded first over the global config, so
it takes priority when resolving variables, thus "overriding" global
configs.
|
|
Adds two functions to librc, rc_set_user() and rc_is_user(). The latter
just queries if the former was called. The former instantiates paths for
locations that make sense for user services:
Script dirs get set to $XDG_CONFIG_HOME/openrc/{init.d,conf.d}, and
variations of the system sysconf dirs with "user.d/" as a suffix.
Runlevel dir is set to $XDG_CONFIG_HOME/openrc/runlevels, and the svcdir
is set to $XDG_RUNTIME_DIR/openrc.
XDG_CONFIG_HOME falls back to $HOME/.config should it be unset.
XDG_RUNTIME_DIR has no fallback, and thus required for user services.
|
|
|
|
|
|
This will be used until the roll-out is completed in the following
issue:
Bug: https://github.com/actions/runner-images/issues/10636
|