Skip to content

udev forking/socket-passing rework - #43

Merged
kaysievers merged 9 commits into
systemd:masterfrom
teg:udev-forking-rework
Jun 3, 2015
Merged

kaysievers merged 9 commits into
systemd:masterfrom
teg:udev-forking-rework

Conversation

@teg

@teg teg commented Jun 2, 2015

Copy link
Copy Markdown
Contributor

This reduces the difference between damon/non-daemon mode and between socket-passing and non-socket passing mode.

As an added bonus also drops the special sigmask handling.

@teg teg added the udev label Jun 2, 2015
teg added 8 commits June 3, 2015 01:41
We used to block all signals, and restore the original signal mask before exec'ing
external processes.

Now we just block the signals we care about and unconditionally unblock all signals
before exec'ing.
If they are passed from PID1 this is not necessary.
This should have no behavioural change, but it is odd to tie the cgroup cleaning to
whether or not we are passed sockets.

The point really is if we are guaranteed to be in a dedicated cgroup, so instead
check for our parent being PID1 (we already implicitly only do this on systemd
systems).
…m_netlink_fd

This allows a fd to be created and configured as part of one monitor, to be passed in
to create a second monitor without having to redo any of the configuration.
Hide the differenec in listen_fds, by simply opening the fds
here in case they are not passed in.
This will allow us in a follow-up commit to listen to fds before forking and
still allocate the manager only after the fork.
This will simply silently fail on non-systemd systems, so there is no reason
to make it conditional.

Also make it clear that we notify systemd about being ready as the last step
before starting the event loop, whereas the forking might need to happen
earlier.
@teg
teg force-pushed the udev-forking-rework branch from 136c53a to 87353bc Compare June 3, 2015 00:06
Now that listen_fds() have been split out, we can safely move the allocation
of the manager object after doing the forking (the fork is done to notify legcay
init-systems that the fds are ready).

Subsequently, we can merge manager_listen() back into managre_new().

This entails a minor behaviour change: the application of permissions to
static device nodes now happens after the fork (but still before notifying
systemd about being ready).
@teg
teg force-pushed the udev-forking-rework branch from 87353bc to 11b1dd8 Compare June 3, 2015 00:13
@teg

teg commented Jun 3, 2015

Copy link
Copy Markdown
Contributor Author

Updated the branch with cgroup rework. Ready to be merged.

kaysievers added a commit that referenced this pull request Jun 3, 2015
udev forking/socket-passing rework
@kaysievers
kaysievers merged commit 1635b34 into systemd:master Jun 3, 2015
mischief added a commit to mischief/systemd that referenced this pull request Apr 6, 2016
needs-update: don't require strictly newer usr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants