| Age | Commit message (Collapse) | Author |
|
|
|
|
|
otherwise /run/openrc might not exist, and result on svcdirfd being -1
Fixes: https://github.com/OpenRC/openrc/issues/888
|
|
|
|
only one consumer, checkpath, and can easily be done directly with the
access syscall
|
|
the exists() helper uses stat.2 unnecessarily, while calling access is
simpler and does not require filling a struct stat for no reason.
since this would make exists() into a wrapper that calls a single
function and nothing else, let's just inline the calls to access and
remove the helper.
|
|
Make it consistent with the other one: in case of error report failed
input.
Also change quoting from `%s' to '%s'.
|
|
Fixes: https://github.com/OpenRC/openrc/issues/874
|
|
|
|
to specify a different host, meson's machine files should be used
instead.
|
|
|
|
|
|
|
|
|
|
Bug: https://bugs.gentoo.org/952108
|
|
with this we can define `notify=socket` as an overall systemd
"notify-socket" compatibility flag. in the future, `nofiy=socket` will
simply enable access to the basic STATUS= command, `socket:ready`
enables READY=1, `socket:fdstore` would enable fd-store compat,
`socket:watchdog:<timeout>` for the watchdog and so on.
the format of the variable would end up being:
`notify="protocol[:option[,option ...]]"`
|
|
openrc-run can be called from places that don't reset the signal mask
before exec, example being the pam close_session session hook called
from runuser, which leads to svc_exec hanging, as SIGCHLD is never
delivered.
Bug: https://bugs.gentoo.org/953748
|
|
|
|
avoids wasting resources by spamming restarts on a service which
would've failed anyways.
|
|
allows specifying increasing respawn delay. for example, to try
respawn immediately at first and then slowly backing off if the
service continues to keep failing within respawn-period to avoid
misusing system resource on trying to keep restarting a bad
service too fast.
|
|
|
|
it makes no sense for the parent to hold the lock, even with cloexec,
and that makes attempts to wait on flock useless. it only worked so far
due to busy-polling with open, so basically, we were waiting for an
unlink, not a lockfile.
|
|
|
|
|
|
this also fixes the behaviour of rc_service_scheduled_by, returning
a stringlist of service names, instead of the script that is being
scheduled.
|
|
Co-authored-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
|
|
|
|
readiness notification is experimental, and imo naming it 'ready' was a
mistake, most other projects call them notify-fd, notify-socket, etc
systemd's protocol in particular, we plan to support a few more keys
than just "READY=1" (namely "STATUS" to begin with), so 'notify' is a
better variable name in my view
|
|
|
|
Fixes: https://github.com/OpenRC/openrc/issues/612
|
|
snprintf return value does not include the nul-byte, so return
of `== size` is also a truncation case.
Fixes: 010b0d5e1b1a20ce4708173bc325d3297b609da7
|
|
the goal is to provide a safe and easy string building api for
new code and to replace some of the old code doing error prone,
ad-hoc coded and manual string building at the moment.
|
|
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
|
|
based on the systemd notify socket protocol, although at the moment we
only support READY=1.
|
|
a few matches were not typos (e.g. ahd), or not changes i'd care to make (e.g.
bootup vs boot up).
Closes: https://github.com/OpenRC/openrc/issues/812
|
|
avoids assuming argv[0] is the command
|
|
|
|
more suitable here since this is exec related and not
necessarily plugin related.
|
|
since rc_exec uses an `execpipe` to detect exec failures inside
the child, this fixes the issue described in 792, but only for
the first layer of exec. there's a /bin/sh in the middle and we
won't be able to detect whether /bin/sh failed to exec the
command without inspecting the (unreliable) exit code.
Ref: https://github.com/OpenRC/openrc/issues/792
|
|
currently there's a lot of ad-hoc fork exec going around. the
goal of this is to centralize most of the typical cases.
|
|
|
|
|
|
Closes: https://github.com/OpenRC/openrc/issues/540
|
|
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.
|
|
|
|
Closes: https://github.com/OpenRC/openrc/issues/781
|
|
|
|
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.
|