-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subprocesses spawned by services get killed on service exit #73
Comments
A few possible solutions:
|
teg
added a commit
to teg/dbus-broker
that referenced
this issue
Nov 2, 2017
This allows forked-off children to survive their parents in case the bus-activated parent is shut down before one of their children. Moreover, make sure to give each transient unit file a unique name, so that a new instance can be started, even if children of an old one are still alive. This addresses issue bus1#11 and bus1#73, implementing a suggestion given in the latter. Reported-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com> Reported-by: Jan Alexander Steffens<jan.steffens@gmail.com> Signed-off-by: Tom Gundersen <teg@jklm.no>
Thanks for the report! We had a similar report in the past, but were resigned to the fact that we would differ from dbus-daemon in this (leaking subprocesses like this really sounds very wrong to me). However, if even gnome is affected, I guess we need to make this work. Using instantiated transient units (with KillMode=process) sounded good to me, so went that route. |
teg
added a commit
that referenced
this issue
Nov 2, 2017
This allows forked-off children to survive their parents in case the bus-activated parent is shut down before one of their children. Moreover, make sure to give each transient unit file a unique name, so that a new instance can be started, even if children of an old one are still alive. This addresses issue #11 and #73, implementing a suggestion given in the latter. Reported-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com> Reported-by: Jan Alexander Steffens<jan.steffens@gmail.com> Signed-off-by: Tom Gundersen <teg@jklm.no>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When services spawn subprocesses, because systemd defaults to
KillMode=control-group
, these processes get killed as well when the main process exits.This is unfortunate as it also applies to applications spawned when e.g. opening files in Nautilus or via Nautilus' search provider.
If the D-Bus service configures a
SystemdService
, this can be fixed by settingKillMode=process
in the unit file. So far, so good.However, this does not work for the transient units generated by dbus-broker; supplying
KillMode
process
results in a different problem: If the control group still exists, starting the transient unit will fail.The text was updated successfully, but these errors were encountered: