aboutsummaryrefslogtreecommitdiff
path: root/sh
AgeCommit message (Collapse)Author
2023-10-19openrc-run.sh: save and load variables on default startAnna (navi) Figueiredo Gomes
temporary system for testing, it's gonna store any environment variables defined in export_vars="", and subsequent services will load them. ideally we only want to load the variables saved by services we depend on, so that would change later. Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
2023-10-19openrc-run.sh.in: Disable cgroups for user services.Anna (navi) Figueiredo Gomes
Since user services run as the user that is starting them, they won't be able to make use of cgroups. Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
2023-10-19openrc-run.sh-in: Conditionally add configs.Anna (navi) Figueiredo Gomes
Conditionally add system provided configs for user services. The local configs for the same services take priority. Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
2023-10-19gendepends.sh.in: Conditionally add user servicesAnna (navi) Figueiredo Gomes
For dependency calculation for user services. When in user service mode, non-user services are not considered. Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
2023-10-10change default RC_CGROUP_MODE to unifiedWilliam Hubbs
This improves resource management by assigning services to individual cgroups. X-Gentoo-Bug: https://bugs.gentoo.org/914972
2023-10-03supervise-daemon: implement output_logger and error_logger.Lexxy Fox
Allows redirecting process stdin and stdout to another process, just like is already possible with start-stop-daemon. Also added --stdout-logger and --stderr-logger to the man page.
2023-01-15netmount: add fuse.glusterfsMike Frysinger
Fixes #495.
2023-01-15init: add missing eend to /run mount #554Mike Frysinger
Fixes #554.
2022-12-07supervise-daemon: don't overwrite empty supervise_daemon_argsJakub Jirutka
If supervise_daemon_args is not set *or empty*, it defaults to `start_stop_daemon_args`. This is bad because supervise-daemon doesn't accept the same options as `start-stop-daemon`. So if we set e.g. `start_stop_daemon_args="--wait 50"`, but not `supervise_daemon_args`, and the user adds `supervisor=supervise-daemon` to the corresponding /etc/conf.d/<service> file, the service will fail to start due to unrecognized option "wait". It would be best to remove this fallback, but that might break some existing scripts that depend on it. So this commit just changes it to use `start_stop_daemon_args` as the default for `supervise_daemon_args` only if `supervise_daemon_args` is not set at all, but not if it's empty. This at least simplifies workarounds; we can just add `supervise_daemon_args="$supervise_daemon_args"` to init scripts. This fixes #558.
2022-07-03fix quoting of loggers in start-stop-daemonpsykose
previously broken in 6034866d1c74d5a23eb9f3e0ebf40c9d278aac93 caused *_logger options to be passed unquoted, so `error_logger="logger -t .."` would pass -t to s-s-d and fail to start the service. Fixes: #531
2022-04-09binfmt: ignore empty lines (#492)mochaaP
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.
2022-03-05Use consistent args passing in start-stop-daemonLinkTed
2022-02-06linux: Add support for No New Privs flagLinkTed
This add No New Privs flag for start-stop-daemon and supervise-daemon by adding --no-new-privs flag. As a result, the user set the No New Privs flag for the program should run with. see PR_SET_NO_NEW_PRIVS prctl(2)
2022-02-06capabilities: Add support for securebits flagsLinkTed
This adds securebits flags for start-stop-daemon and supervise-daemon by adding --secbits option. As a result, the user can specify securebits the program should run with. see capabilities(7)
2021-12-29build: rename sh_dir variable to rc_shdirWilliam Hubbs
2021-12-23capabilities: Add support for Linux capabilities(7)LinkTed
This adds capabilities for start-stop-daemon by adding --capabilities option. As a result, the user can specify the inheritable, ambient and bounding set by define capabilities in the service script. This fixes #314.
2021-12-20use HEAD in git URIs to point to the default branchMike Frysinger
This makes the URIs shorter and dynamic: whatever the default branch the repo uses will be used.
2021-10-15 Use cgroup.kill in cgroup_cleanup when possibleAidan Harris
The old code is moved to a cgroup_fallback_cleanup function and only called if cgroup2_kill fails. This fixes #454.
2021-09-11[runit integration] give a bit of time to start the serviceAaditya Bagga
Currently, we run sv start immediately after linking the service. The runsv process may not be up at the moment, as a result of which openrc will mark the service as stopped, even though it may be brought up by runit at the next scan. This is documented in the gentoo wiki: https://wiki.gentoo.org/wiki/Runit#OpenRC.27s_runit_integration_feature This PR adds a timeout so that correct process state can be reported. Before: * Starting netdata-runit ... fail: /run/openrc/sv/netdata: runsv not running * Failed to start netdata-runit After: * Starting netdata-runit ... fail: /run/openrc/sv/netdata: runsv not running ok: run: /run/openrc/sv/netdata: (pid 9042) 0s This fixes #253.
2021-09-09rc-mount: make timeout invocation compatible with busybox timeoutSören Tempel
Busybox timeout does not support the `-k` flag. As such, invoking fuser from do_unmount never worked without this patch. This went unnoticed as standard error is redirected to /dev/null. This patch fixes this by simply removing the incompatible `-k` flag. [Ariadne: the `-k` is redundant anyway, since we are sending the KILL signal to begin with.]
2021-09-06build: change root_prefix to rootprefixWilliam Hubbs
2021-09-04add meson build filesWilliam Hubbs
Closes #116. Closes #171. Closes #172. Closes #175.
2021-08-12sh/rc-cgroup.sh: fix case in starting messageWilliam Hubbs
X-Gentoo-Bug: 804193 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=804193
2021-08-12sh/rc-cgroup.sh: fix cgroup_cleanupWilliam Hubbs
X-Gentoo-Bug: 804193 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=804193
2021-04-04cgroup2_set_limits: fix harmless error messageWilliam Hubbs
In legacy cgroups mode, we were running `mountinfo -q ""` which was generating an error message. If we return immediately when cgroup2_find_path returns an empty value, we avoid this message.
2021-03-22init.sh: rework the /run setup for linux xystemsWilliam Hubbs
- fix mount options for /run. - run restorecon after everything is set up. X-Gentoo-Bug: 740576 X-Gentoo-Bug-URL: https://bugs.gentoo.org/740576
2021-03-15rc_cgroup.sh: do not add newline when writing group2 valuesWilliam Hubbs
Fixes: #407
2021-03-01rc-cgroup.sh: avoid process substitution for cgroup_get_pidsWilliam Hubbs
This should make cgroup_cleanup work successfully since cgroup_get_pids no longer uses a subshell. This fixes #396. This fixes #397.
2021-01-05typo fixWilliam Hubbs
2021-01-05improve the diagnostic when the ulimit builtin failsWilliam Hubbs
X-Gentoo-Bug:739274 X-Gentoo-Bug-URL:https://bugs.gentoo.org/739274
2020-01-11binfmt: ensure a file is ungegistered before registeringartoo
This fixes #328
2020-01-11make grep usage POSIX compliantEthan Sommer
use grep -E instead of egrep check for space or end of line instead of GNU-specific word boundary This fixes #345
2019-09-03cgroup2_set_limits: verify that the cgroup2 path is a mount pointE5ten
prior to cgroups getting mounted, /sys/fs/cgroup will still exist, but attempts to make directories in it will fail, change cgroup2_set_limits() to verify that cgroups are mounted instead of just checking that /sys/fs/cgroup exists. This fixes #307. This fixes #321.
2019-02-22combine test directoriesWilliam Hubbs
This fixes #295.
2019-02-13add experimental support for an alternate shell for service scriptsWilliam Hubbs
This is for #288.
2018-12-23remove /run migration script againWilliam Hubbs
This time it was done correctly. I missed a '\' the last time.
2018-12-23Revert "remove /run migration script"William Hubbs
For some reason removing this broke the build. This reverts commit 5246ea7b6f8c6a247403f725f8301457f6ddfffd.
2018-12-23remove /run migration scriptWilliam Hubbs
We have used /run for some time now and we have had this migration script for 6 years. Linux users should have upgraded by now to a version of OpenRC which stores its information in /run.
2018-12-08standardize the default shellWilliam Hubbs
I do not know of a need to have the default shell be a build-time configurable setting. All *nix systems I am aware of have /bin/sh as a default posix compatible shell. If some systems running OpenRC do not make that assumption about /bin/sh, I will consider bringing this back, so feel free to open an issue.
2018-12-07rc-cgroup.sh: remove shebang lineWilliam Hubbs
This is not a stand-alone script, so it does not need the shebang line. This also means it is not necessary to run this through sed.
2018-12-03supervise-daemon.sh: drop the unused stopsig variableWilliam Hubbs
2018-12-03supervise-daemon: use a default pid file if one is not specifiedWilliam Hubbs
Since the pid file is internal to us, start moving toward deprecating it by not requiring the user to specify it. In the next release, I plan on working on code to start phasing out the use of a pid file if this is possible.
2018-11-18sh/functions.sh.in: return a different value for invalid input in yesno()Austin English
2018-11-15supervise-daemon: make the pidfile an implementation detailWilliam Hubbs
The pidfile of the supervisor doesn't need to be adjustable by the service script. It is only used so the supervisor can stop itself when the --stop option is used.
2018-11-06supervise-daemon.sh: drop invalid --signal switchWilliam Hubbs
This fixes #230.
2018-10-23supervise-daemon: add health checksWilliam Hubbs
Health checks are a way to monitor a service and make sure it stays healthy. If a service is not healthy, it will be automatically restarted after running the unhealthy() function to clean up.
2018-10-13misc: whitespace fixesAustin English
2018-07-09rc-functions.sh: Remove addon supportWilliam Hubbs
This is an old relic from Gentoo baselayout-1.x which should not be used any longer.
2018-06-15sh/start-stop-daemon.sh: fix processing of the logger argumentsWilliam Hubbs