-
Notifications
You must be signed in to change notification settings - Fork 71
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
RFC: better systemd --user
integration
#301
base: master
Are you sure you want to change the base?
Conversation
038b071
to
68cd35e
Compare
Ignore $ppid if it is an instance of the systemd manager. This prevents `systemd --user` from being treated as a parent process of all non-double-forked `systemd --user` services.
Ideally, we'd do something more reasonable, like treating them similarly to system services and maybe even offering to restart some of them or at the very least printing them in a format suitable for copy-pasting, but for now just replace the process name with the service name and save them under a separate key to hopefully distinguish them from other processes under `systemd --user`.
68cd35e
to
470397c
Compare
Can this be useful for #289? |
@Vladimir-csp yes, I believe it can. This needs a bit more UI work (the code I wrote piggybacks on existing data structures used for raw session processes, so it does not offer to perform a |
@liske ping, is there any chance this PR could get reviewed? There has been a new release since this PR was posted, so I'm assuming there must be some sort of problem with this code specifically? |
Sorry the security fixes for 3.8 have taken some time over the last few weeks and I was not able to take time for this more complex issue, yet. Scheduling it for the next release. |
Thanks. I just wanted to make sure this PR would actually be desired before I rebase it on top of the new changes. |
Systemd-managed user sessions with apps in units were already a reality in Gnome and at least some other major DEs. I helped a bit to make it happen in independent compositors also. |
I need to reschedule this for 3.10. Needrestart 3.9 will be release ASAP to fix the regression reported in #317. |
Right now, processes running under
systemd --user
confuse needrestart in several ways:systemd --user
as the logical parent (which means that needrestart will bogusly reportsystemd
itself as the process that needs to be restarted);systemd --user
instance itself needs a restart, needrestart won't do anything about it;systemd --user
(as opposed to an arbitrary process started in a user scope), needrestart won't use this information in any way.This PR offers a clean solution for (1) by disregarding the parent if it is a
systemd --user
instance (implemented via matching the cgroup of the parent against/init.scope$
), and pretty hacky solutions for (2) and (3) (hence the RFC status).