As commented in bug 463784, we need a way to handle processes inside a cgroup is needed. In that exact case, we would simply need to add a way to run "kill -- -<pid>" using start-stop-daemon. After talking with gdm upstream, they think this needs to be handled by init system: https://bugzilla.gnome.org/show_bug.cgi?id=700152#c6 Thanks Reproducible: Always
I believe we have something in git that will do what you are requesting. Check commit c98450.
(In reply to comment #1) > I believe we have something in git that will do what you are > requesting. Check commit c98450. Thanks I have tried to apply the patch to current latest released version but it fails: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=patch;h=c98450;hp=e4668a5061de4f225d4e9d534ff6212e634e45d2 I could update to "9999" but I am unsure if latest openrc is stable enough (I don't want to not be able to boot my only working systemd just now :S) Regarding how is this being handled in the commit, I am unsure about how we will be able to call the cleanup part taking care xdm init.d script is used for different DMs, maybe "rc_cgroup_cleanup="NO"" could be set in /etc/INIT.D/xdm when gdm is used :/
> Regarding how is this being handled in the commit, I am unsure about how we > will be able to call the cleanup part taking care xdm init.d script is used > for different DMs, maybe "rc_cgroup_cleanup="NO"" could be set in > /etc/INIT.D/xdm when gdm is used :/ to kill all services on stop you should set rc_cgroup_cleanup="YES", because killing all services in cgroup is not default behaviour. To fix situation you may add if [ ${DISPLAYMANAGER} == "gdm" ] ; then $rc_group_cleanup = "yes"; fi it the toplevel of initscript or conf.d file.
It fails with this: # LC_ALL=C /etc/init.d/xdm restart xdm |/etc/init.d/xdm: line 41: =: command not found xdm | * Stopping gdm ... xdm | * start-stop-daemon: no matching processes found [ ok ] xdm |/etc/init.d/xdm: line 41: =: command not found xdm | * Setting up gdm ... xdm | * start-stop-daemon: /usr/sbin/gdm is already running xdm | * ERROR: could not start the Display Manager [ ok ]
Created attachment 349114 [details] xdm My xdm script
Created attachment 349116 [details] xdm script that handles rc_cgroup_cleanup sorry I have to much spelling misstakes in my comment. Attaching correct version:
Created attachment 349122 [details] xdm I am using this one that handles cgroup as yours but will needed changes for gdm3 (pid file location, start_stop_daemon options...), but it fails with the following: # /etc/init.d/xdm start xdm | * Caching service dependencies ... [ ok ] xdm | * Setting up gdm ... [ ok ] xdm | * starting cgroups cleanup ... xdm |/lib64/rc/sh/rc-cgroup.sh: línea 24: = 5789: no se encontró la orden xdm |/lib64/rc/sh/rc-cgroup.sh: línea 24: = 5794: no se encontró la orden [ ok ] and the same occurs when stopping, and it still doesn't kill childs :S
(In reply to comment #7) > Created attachment 349122 [details] > xdm > > I am using this one that handles cgroup as yours but will needed changes for > gdm3 (pid file location, start_stop_daemon options...), but it fails with > the following: > # /etc/init.d/xdm start > xdm | * Caching service dependencies ... [ ok ] > xdm | * Setting up gdm ... [ ok ] > xdm | * starting cgroups cleanup ... > xdm |/lib64/rc/sh/rc-cgroup.sh: línea 24: = 5789: no se > encontró la orden > xdm |/lib64/rc/sh/rc-cgroup.sh: línea 24: = 5794: no se > encontró la orden > [ ok ] > > and the same occurs when stopping, and it still doesn't kill childs :S can you attach /lib64/rc/sh/rc-cgroup.sh file you are using? It seems that it's not properly patched as I have no such error (at least with xdm). I can try to use gdm3.
Created attachment 349132 [details] rc-cgroup.sh That is the file, I am not patching it, simply running -9999 build from some hours ago
(In reply to comment #9) > Created attachment 349132 [details] > rc-cgroup.sh > > That is the file, I am not patching it, simply running -9999 build from some > hours ago Thanks I've found a bug in cleanup implementation, I'll update this bug when fix will be merged upstream.
Thanks a lot Alexander!
(In reply to Pacho Ramos from comment #11) > Thanks a lot Alexander! patch was applied upstream. And thanks to William for fixing my patch. You can test it once again.
It works now :D But I get the following when stopping (even killing processes properly): # LC_ALL=C /etc/init.d/xdm stop xdm | * Stopping gdm ... [ ok ] xdm | * starting cgroups cleanup ... xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2078) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2082) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2083) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2084) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2085) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2086) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2090) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2091) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2092) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2093) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2095) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2097) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2098) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2099) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2108) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2118) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2119) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2123) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2125) - No such process xdm |/lib64/rc/sh/rc-cgroup.sh: line 113: kill: (2134) - No such process [ ok ]
Maybe some output is not being properly redirected to /dev/null :/ (because processes are properly killed before showing that messages)
Created attachment 350372 [details, diff] patch that fixes situation this patch fixes situation. Also I've sent it by pull request on github with one other small cgroup patch.
Works fine! Thanks :) But we need a release of openrc including all this support to let me start working on updated xorg-server ebuilds providing new xdm init.d script for gdm3 (and also bump finally gdm-3 dropping most of ugly (and now broken) hacks we were carrying to make it compatible with old scripts ) Thanks
I've added a dependency on openrc-0.12 tracker.
I confirm that it works fine.