Go to file
Matt Whitlock 112b69860f start-stop-daemon, supervise-daemon: set autogroup nicelevel
As described in "Why nice levels are a placebo and have been for a very
long time, and no one seems to have noticed"[1], the Linux kernel in its
default configuration on many Linux distributions autogroups tasks by
session ID and "fairly" allocates CPU time among such autogroups. The
nice levels of tasks within each autogroup are only relative to
other tasks within the same autogroup. Effectively, this means that the
traditional nice level is rendered moot for tools like start-stop-daemon
and supervise-daemon, which start each daemon in its own session and
thus in its own autogroup. Linux does provide a means to change the
niceness of autogroups relative to each other, so let's have start-stop-
daemon and supervise-daemon make use of this feature where available so
that -N,--nicelevel/SSD_NICELEVEL will actually do what the user
intends. On systems where autogroups are not supported or are disabled,
this commit introduces no change in behavior.

Note that the setsid() call in the child process of start-stop-daemon is
moved to much earlier. This is necessary so that the new process will be
assigned to a new autogroup before the autogroup nicelevel is set. To
avoid inadvertently acquiring /dev/tty as the controlling terminal of
the new session after setsid() has given up the controlling terminal
inherited from the parent process, tty_fd is opened before the call to
setsid().

[1] https://www.reddit.com/r/linux/comments/d7hx2c/why_nice_levels_are_a_placebo_and_have_been_for_a/
This fixes #542.
2022-09-06 17:26:22 -05:00
.github/workflows simplify github workflows using the matrix syntax 2022-04-16 15:15:15 -05:00
bash-completion migrate fully to meson build system 2022-04-06 10:51:55 -05:00
ci rewrite tests (#515) 2022-04-16 15:13:08 -05:00
conf.d multiple spelling and typo fixes 2022-04-30 21:32:32 -05:00
etc multiple spelling and typo fixes 2022-04-30 21:32:32 -05:00
init.d init.d/root: don't remount swap 2022-09-04 18:44:47 -05:00
local.d migrate fully to meson build system 2022-04-06 10:51:55 -05:00
man multiple spelling and typo fixes 2022-04-30 21:32:32 -05:00
pkgconfig migrate fully to meson build system 2022-04-06 10:51:55 -05:00
sh fix quoting of loggers in start-stop-daemon 2022-07-03 12:40:34 -05:00
src start-stop-daemon, supervise-daemon: set autogroup nicelevel 2022-09-06 17:26:22 -05:00
support multiple spelling and typo fixes 2022-04-30 21:32:32 -05:00
sysctl.d migrate fully to meson build system 2022-04-06 10:51:55 -05:00
test multiple spelling and typo fixes 2022-04-30 21:32:32 -05:00
tools restore the init symlink for sysvinit mode 2022-06-10 10:28:57 -05:00
zsh-completion migrate fully to meson build system 2022-04-06 10:51:55 -05:00
.cirrus.yml cirrus: drop FreeBSD 11 and 12.2, add FreeBSD 12.3 2022-05-08 19:00:00 -05:00
.clangd Add clangd support for development 2022-03-31 00:52:36 -05:00
.gitignore migrate fully to meson build system 2022-04-06 10:51:55 -05:00
.travis.yml update travis ci irc notifications 2021-08-14 15:05:07 -05:00
agetty-guide.md Reformat and fix titles in documentation 2018-01-12 14:10:42 -06:00
AUTHORS Use seedrng for seeding the random number generator 2022-03-26 19:16:27 -05:00
BUSYBOX.md Reformat and fix titles in documentation 2018-01-12 14:10:42 -06:00
FEATURE-REMOVAL-SCHEDULE.md Reformat and fix titles in documentation 2018-01-12 14:10:42 -06:00
HISTORY.md Reformat and fix titles in documentation 2018-01-12 14:10:42 -06:00
init-guide.md Delete stray text. 2020-01-11 11:15:56 -06:00
LICENSE Convert OpenRC to a centralized copyright/license structure 2015-12-21 12:16:06 -06:00
meson_options.txt capabilities: Add support for Linux capabilities(7) 2021-12-23 17:29:10 -05:00
meson.build restore the init symlink for sysvinit mode 2022-06-10 10:28:57 -05:00
NEWNET.md NEWNET.md: fix the title 2021-04-03 15:18:30 -05:00
NEWS.md add note about seedrng to news 2022-06-07 17:43:24 -05:00
README.md migrate fully to meson build system 2022-04-06 10:51:55 -05:00
runit-guide.md Reformat and fix titles in documentation 2018-01-12 14:10:42 -06:00
s6-guide.md Reformat and fix titles in documentation 2018-01-12 14:10:42 -06:00
service-script-guide.md Add newline for want 2022-03-05 13:14:21 -05:00
STYLE-GUIDE.md Reformat and fix titles in documentation 2018-01-12 14:10:42 -06:00
supervise-daemon-guide.md multiple spelling and typo fixes 2022-04-30 21:32:32 -05:00
TODO Add a potential future problem I can see with metric calculation and interfaces that change often. 2012-03-02 19:51:09 +00:00
user-guide.md user-guide: clarify note for Runlevels/rc-update usage 2020-12-20 13:54:33 +01: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.