Bug 6842 - Alt-SysRq-R,E,I,S,U,B broken with systemd in Mageia 2
Summary: Alt-SysRq-R,E,I,S,U,B broken with systemd in Mageia 2
Status: RESOLVED INVALID
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 2
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-21 18:09 CEST by Anderson Carvalho
Modified: 2012-07-26 12:12 CEST (History)
2 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments

Description Anderson Carvalho 2012-07-21 18:09:57 CEST
Description of problem: 
 Curmudgeon recently tried to restart a Mageia system using the time-honored REISUB method (aka Magic SysRq keys).

 Curmudgeon discovered that both Alt-SysReq-E and Alt-SysReq-I don't do what I've come to expect them to over many years of Linux use, that is, send TERM and KILL signals, respectively.

Rather, they both seem to restart the DM (complete with auto-login, if it's turned on), which would seem exactly counter to what these commands are traditionally supposed to do (that is, stop processes, not spawn/respawn them).

Version-Release number of selected component (if applicable):
systemd 44-13.mga2


How reproducible:
There really is a loop (bug) and the X (DM) is restarting every time I press Alt-SysReq-I

Steps to Reproduce:
1. Repeatedly press Alt-SysReq-I in Mageia 2
2.
3.
Comment 1 Manuel Hiebel 2012-07-21 23:56:02 CEST
does it work with echo e (or i) > /proc/sysrq-trigger ?
Comment 2 Manuel Hiebel 2012-07-22 00:02:15 CEST
ah yes and "cat /proc/sys/kernel/sysrq" show what ?
Comment 3 Anderson Carvalho 2012-07-22 00:14:01 CEST
# echo e > /proc/sysrq-trigger
and
# echo i > /proc/sysrq-trigger
the X (DM) is restarting too. If you make 10 times, restarts the X (DM) 10 times.

$ cat /proc/sys/kernel/sysrq
1

I think it do not is the keyboard, and yes as systemd handles requests from the shortcut:
'e' - Send a SIGTERM to all processes, except for init.
'i' - Send a SIGKILL to all processes, except for init.
Comment 4 Anderson Carvalho 2012-07-22 00:20:28 CEST
Before Mageia 2 with systemd always worked as described in http://www.kernel.org/doc/Documentation/sysrq.txt
Comment 5 Anderson Carvalho 2012-07-22 00:25:56 CEST
Take a look at this comment:
https://bugzilla.redhat.com/show_bug.cgi?id=752593#c33
Comment 6 Colin Guthrie 2012-07-25 17:52:13 CEST
This is expected behaviour. The DM is meant to restart after the binary dies. Just typing killall X (or perhaps the containing DM) would exhibit the same behaviour - i.e. it is nothing to do with the sysreq keys.

If you don't like this behaviour simply copy the prefdm.service systemd unit to /etc/systemd/system/, edit it accordingly to disable the restart and run "systemctl enable --force prefdm.service"

Status: NEW => RESOLVED
CC: (none) => mageia
Resolution: (none) => INVALID

Olav Vitters 2012-07-25 17:54:30 CEST

CC: (none) => olav
Summary: REISUB broken with SystemD in Mageia 2 => Alt-SysRq-R,E,I,S,U,B broken with systemd in Mageia 2

Comment 7 Anderson Carvalho 2012-07-25 20:42:01 CEST
How sysvinit has another behavior I imagined bug.

I'll test and comment on the result to prevent this loop.
Comment 8 Anderson Carvalho 2012-07-26 00:22:00 CEST
I did as told and did not work:

# systemctl enable --force prefdm.service
Warning: unit files do not carry install information. No operation executed.
Comment 9 Colin Guthrie 2012-07-26 10:19:28 CEST
Oh right, yeah it doesn't include install info and is just enabled statically, so just add the following to the unit file:

[Install]
WantedBy=graphical.target



And then rerun the enable command.
Comment 10 Colin Guthrie 2012-07-26 10:21:30 CEST
Actually, make that:

[Install]
Alias=display-manager.service
WantedBy=graphical.target


(the prefdm.service is a bit quirky install wise, but it's being phased out so it'll be easier to customise in mga3)
Comment 11 Anderson Carvalho 2012-07-26 12:07:55 CEST
I tested it and now everything worked as expected. Thank you!
Comment 12 Colin Guthrie 2012-07-26 12:12:35 CEST
No problem. Note that if you have the same system when you upgrade to Mageia 3 then you will likely have to tidy this up (which would just be a matter of a (systemctl disable prefdm.service and the an rm of the copied unit itself). This is because we'll likely move away from this massively ugly wrapper around the various DMs and let each have their own separate unit (e.g. gdm.service, kdm.service etc). On the flip side, this should then make your preferred DM easier to fiddle with in the future :)

Note You need to log in before you can comment on or make changes to this bug.