[Bug 852132] New: KillUserProcesses=yes does not work at least with KillOnlyUsers
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c0 Summary: KillUserProcesses=yes does not work at least with KillOnlyUsers Classification: openSUSE Product: openSUSE 13.1 Version: Final Platform: x86-64 OS/Version: openSUSE 13.1 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: systemd-maintainers@suse.de ReportedBy: werner@suse.com QAContact: qa-bugs@suse.de CC: werner@suse.com, fcrozat@suse.com Found By: Development Blocker: --- To see this /suse/werner> grep ^Kill /etc/systemd/logind.conf KillUserProcesses=yes KillOnlyUsers=linux after login, setting up a `batch job' with simply with sleep, and a simply logout: /suse/werner> ps aux | grep ^linux linux 3763 0.0 0.1 38096 2280 ? Ss 12:08 0:00 /usr/lib/systemd/systemd --user linux 3764 0.0 0.0 72912 1852 ? S 12:08 0:00 (sd-pam) linux 3816 0.0 0.0 4520 572 ? S 12:08 0:00 sleep 1000 .. I've rebooted the system before testing this to be sure that systemd-logind has read its corect configuration. This bug is related to bnc #849870 I'm asking me if upstream has something like QA managment :( -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c1 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |fcrozat@suse.com --- Comment #1 from Dr. Werner Fink <werner@suse.com> 2013-11-25 11:26:01 UTC --- @Frederic: Do you know if this is one of our/upstream patches of does this also happen with plain systemd 208? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c2 --- Comment #2 from Dr. Werner Fink <werner@suse.com> 2013-11-25 11:29:48 UTC --- Even without KillOnlyUsers=linux the systemd-logind manager does not terminate/kill the sleep process :( -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c3 Frederic Crozat <fcrozat@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|fcrozat@suse.com | --- Comment #3 from Frederic Crozat <fcrozat@suse.com> 2013-12-11 13:11:53 UTC --- (In reply to comment #1)
@Frederic: Do you know if this is one of our/upstream patches of does this also happen with plain systemd 208?
Nothing there.. and I think it is being discussed in the upstream mailing list this week. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c4 Dr. Werner Fink <werner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |fcrozat@suse.com --- Comment #4 from Dr. Werner Fink <werner@suse.com> 2013-12-19 15:35:25 UTC --- (In reply to comment #3) Are there any solutions/patches for this problem? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c5 Frederic Crozat <fcrozat@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|fcrozat@suse.com | --- Comment #5 from Frederic Crozat <fcrozat@suse.com> 2013-12-19 15:45:58 UTC --- I think it is related to bnc#849870 which has now a solution. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c6 --- Comment #6 from Dr. Werner Fink <werner@suse.com> 2013-12-19 15:50:52 UTC --- Found message 201312171220.18019.twhitehead@gmail.com without any answer ... indeed the SR #211697 includes 0001-logind-garbage-collect-stale-users.patch I'll test this out at tomorrow -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c7 --- Comment #7 from Dr. Werner Fink <werner@suse.com> 2013-12-20 12:22:27 UTC --- Hmmm ... linux /suse/werner> grep ^Kill /etc/systemd/logind.conf KillUserProcesses=yes KillOnlyUsers=linux linux /suse/werner> ps aux | grep sleep avahi-a+ 3174 0.0 0.0 6748 524 ? S 12:56 0:00 avahi-autoipd: [enp0s3] sleeping linux 4908 0.0 0.0 4520 572 ? S 13:13 0:00 sleep 10000 werner 4946 0.0 0.0 9268 936 pts/0 S+ 13:14 0:00 grep sleep this seems not to work whereas bug #849870 seems to be (partly?) fixed. After running a linux:~ # killall sleep on the serial console there remains a few minutes a process linux:~ # ps aux | grep systemd | grep -e --user root 4563 0.0 0.1 38096 2300 ? Ss 13:04 0:00 /usr/lib/systemd/systemd --user linux 4695 0.0 0.1 38096 2448 ? Ss 13:11 0:00 /usr/lib/systemd/systemd --user which disappears then, a typical garbage collection behaviour. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c8 --- Comment #8 from Frederic Crozat <fcrozat@suse.com> 2013-12-20 12:39:30 UTC --- Indeed, seems to be another case :( -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c9 --- Comment #9 from Dr. Werner Fink <werner@suse.com> 2013-12-20 12:56:15 UTC --- AFAICS from source the function manager_shall_kill() in src/login/logind-core.c should return boolean true for user "linux" and this cause that the function manager_start_scope() is called with kill_mode == "control-group" in src/login/logind-session.c in session_start_scope() ... Following manager_start_scope() to src/login/logind-dbus.c shows if (!isempty(kill_mode)) { const char *kill_mode_property = "KillMode"; if (!dbus_message_iter_open_container(&sub, DBUS_TYPE_STRUCT, NULL, &sub2) || !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &kill_mode_property) || !dbus_message_iter_open_container(&sub2, DBUS_TYPE_VARIANT, "s", &sub3) || !dbus_message_iter_append_basic(&sub3, DBUS_TYPE_STRING, &kill_mode) || !dbus_message_iter_close_container(&sub2, &sub3) || !dbus_message_iter_close_container(&sub, &sub2)) return log_oom(); -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c10 --- Comment #10 from Dr. Werner Fink <werner@suse.com> 2013-12-20 13:53:53 UTC --- .. further debugging ... linux:~ # loginctl show-user linux -a | grep Session Sessions=13 linux:~ # systemctl show user@32003.service | grep Kill KillMode=control-group KillSignal=15 indeed the code works, nevertheless the user has logged off and the started sleep is remaining in the session 13
From manual page systemd.kill(5) I can read
KillMode= Specifies how processes of this service shall be killed. One of control-group, process, none. If set to control-group, all remaining processes in the control group of this unit will be terminated on unit stop (for services: after the stop command is executed, as configured with ExecStop=). If set to process, only the main process itself is killed. If set to none, no process is killed. In this case only the stop command will be executed on unit stop, but no process be killed otherwise. Processes remaining alive after stop are left in their control group and the control group continues to exist after stop unless it is empty. Defaults to control-group. it seems that the unit isn't stopped: linux:~ # systemctl list-units | grep 32003 user@32003.service loaded active running User Manager for 32003 user-32003.slice loaded active active user-32003.slice -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=852132 https://bugzilla.novell.com/show_bug.cgi?id=852132#c11 --- Comment #11 from Dr. Werner Fink <werner@suse.com> 2013-12-20 14:44:37 UTC --- Seems that there is a difference between sessions and scopes: linux:~ # systemctl list-units | grep scope session-2.scope loaded active running Session 2 of user root session-8.scope loaded active running Session 8 of user linux linux:~ # systemctl show session-8.scope | grep KillMode= KillMode=control-group linux:~ # systemctl show session-2.scope | grep KillMode= KillMode=none and indeed a linux:~ # systemctl stop session-8.scope works with ``Connection to g7 closed by remote host.'' whereas linux:~ # systemctl stop user@32003.service does hang. IMHO the documentation of systemd isn't that clear. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com