aboutsummaryrefslogtreecommitdiff
path: root/src/openrc-run
AgeCommit message (Collapse)Author
2024-07-21openrc-run: chdir into HOME for user services.Anna (navi) Figueiredo Gomes
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. Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
2024-07-21openrc-run: fix check for argument countAnna (navi) Figueiredo Gomes
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
2024-07-20openrc-run.c: allow --user on shebangsAnna (navi) Figueiredo Gomes
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
2024-07-20openrc-run: allow multiplexed symlinks to live outside init.dAnna (navi) Figueiredo Gomes
use the realpath of the target to locate which sysconf dir it's in, using it as a base to load the config file. the service path is then normalized from the symlink without dereferencing it. Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
2024-07-19openrc: dynamic paths for user servicesAnna (navi) Figueiredo Gomes
add two api functions, `rc_service_dir` and `rc_sysconf_dir`, both are generate paths (and sub-paths) for resources, and meant to replace the hardcoded variables like `RC_SVCDIR`. those functions differ by dynamically switching between the system path, or the user path, set in their home folder or runtime directory. this lays out the intial support for user services. Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
2023-11-15remove warning for runscript deprecationWilliam Hubbs
2023-11-14drop the deprecated runscript binaryWilliam Hubbs
2023-04-24openrc-run: fix rc_parallel race in svc_execDominique Martinet
svc_exec waits until SIGCHLD comes in to close its input, but in rc_parallel case the SIGCHLD might be unrelated. Checking the proper pid is found in signal handler and only signaling signal_pipe the status code directly avoids this problem.
2023-04-24openrc-run: silence lock failures with --no-depsDominique Martinet
work around scary warnings described in previous commit
2023-04-24openrc-run: remove kludge in restart --no-depsDominique Martinet
restarting a service with --no-deps ran into a "hairy workaround", which had a few problems discussed in [1]: - it ignores --dry-run, really restarting the requested service - if the service was stopped, the program is started but the service status stays stopped. This makes long-lived services impossible to (re)start again (pid already exists and running), and the service also won't stop on shutdown. The kludge had a long comment describing the following situation: - openvpn needs net and dns - net restarts dns - dns needs net If the restart in net handled deps, openrc would deadlock waiting for net in dns' restart, as net won't be started until that is done. Restarting with --nodeps works around the deadlock, but can display errors without the kludge (note that the services did start properly anyway, the problem is that the default service path tries to lock dns twice from openvn's dep's start and net's start's restart): --- alpine:~# rc-service openvn start openvn | * Caching service dependencies ... [ ok ] net |net starting net |dns | * Call to flock failed: Resource temporarily unavailable net |dns | * ERROR: dns stopped by something else net |net started dns |dns started openvn |openvn started alpine:~# rc-status | grep s[1-3] net [ started ] dns [ started ] openvn [ started ] --- Locking again in restart --nodep can fail in two patterns: - openvpn's need dependency start was first, and the restart in net failed (case above): we can just silence locking failures and exit quietly with restart --no-deps, which is not worse than trying to restart while another process hold the lock. - the restart in net's start was first, and openvpn's need dependency start failed: not much can be done here short of adding a new status that a no-deps restart is in progress as in the comment, but this case can actually just be solved by adjusting dependencies -- and it actually has already been fixed: the current openvpn init script in alpine only 'use dns', so it will not try to start it, and that will start just fine with openvpn -> net -> dns only each starting each other once sequentially. Another failure pattern is just starting dns directly: that will start net, which will try to restart dns while we are starting it. Silencing messages on restart also solves this. Link: https://github.com/OpenRC/openrc/issues/224 [1]
2023-01-30openrc-run: avoid malloc inside sig-handlerNRK
same rational as 459783bb Bug: https://github.com/OpenRC/openrc/issues/589
2023-01-29openrc-run: missing includes from IWYUSam James
2023-01-25openrc-run: drop strlen dead storeSam James
2023-01-25openrc-run: fix -Wunused-but-set-variableSam James
2023-01-25openrc, openrc-run: Fix -Wstrict-prototypesSam James
These become fine with C23 because () starts to mean (void) then, but for previous language versions, it's deprecated, and it causes an annoying warning when building with Clang by default. Plus, GCC lacks specific flags to trigger what C23 *does* ban, so a lot of people are going around building with -Wstrict-prototypes, so let's just fix this to be consistent with the rest of the codebase anyway to fend off false positive reports.
2023-01-15openrc-run: add status to basic usage messageMike Frysinger
Fixes #491.
2022-04-30multiple spelling and typo fixesJosh Soref
This fixes #516.
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.