Dominique Martinet a3c721b682 openrc-run: remove kludge in restart --no-deps
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-04-24 22:06:41 -05:00
2022-04-16 15:13:08 -05:00
2023-01-15 15:24:51 -05:00
2022-04-30 21:32:32 -05:00
2022-04-30 21:32:32 -05:00
2022-03-31 00:52:36 -05:00
2022-04-06 10:51:55 -05:00
2021-08-14 15:05:07 -05:00
2021-04-03 15:18:30 -05:00
2023-04-18 00:13:16 -05:00
2022-04-06 10:51:55 -05:00
2022-03-05 13:14:21 -05:00

OpenRC README

OpenRC is a dependency-based init system that works with the system-provided init program, normally /sbin/init.

building and installing

OpenRC uses the meson build system, so use the usual methods for this build system to build and install.

Notes

We don't support building a static OpenRC with PAM.

PKG_PREFIX should be set to where packages install to by default.

LOCAL_PREFIX should be set to where user maintained packages are. Only set LOCAL_PREFIX if different from PKG_PREFIX.

ROOTPREFIX should be set when the root path is different from '/'.

rc and rc.shutdown are the hooks from the BSD init into OpenRC.

devd.conf is modified from FreeBSD to call /etc/rc.devd which is a generic hook into OpenRC.

inittab is the same, but for SysVInit as used by most Linux distributions. This can be found in the support folder.

Obviously, if you're installing this onto a system that does not use OpenRC by default then you may wish to backup the above listed files, remove them and then install so that the OS hooks into OpenRC.

Discussions

We are testing discussions, so feel free to open topics there.

Reporting Bugs

Please report bugs on our bug tracker.

If you can contribute code , please feel free to do so by opening pull requests.

IRC Channel

We have an official irc channel, #openrc on the libera network. Please connect your irc client to irc.libera.chat and join #openrc on that network.

Description
No description provided
Readme 7.8 MiB
Languages
C 65.8%
Shell 29.7%
Meson 4.3%
Perl 0.2%