| Xenguy | Hi all, I'm looking for a nice clean way to restart Xorg, in situations where I apt-get upgrade and find that I need to restart Xorg because I'm running a now outdated binary... | 14:50 |
|---|---|---|
| Xenguy | I know that I can simply restart my display manager (slim in this case), but I was wondering if there is a way to accomplish the same by using runlevels, i.e. the 'init' command... | 14:51 |
| fsmithred | oh yeah, init 1, then ctrl-d | 14:51 |
| Xenguy | For example, would running 'init 1' (dropping to single user mode), and then running 'init 2' work? | 14:51 |
| Xenguy | Oh, hrm, interesting | 14:52 |
| fsmithred | well, to issue init 2 you would first need to enter root password | 14:52 |
| CueXXIII | you just need to log out an in again, your disply manager restarts X for each new login | 14:52 |
| fsmithred | yeah, you don't really need to restart all the services | 14:53 |
| Xenguy | So humor me, what would be the cleanest/simplest way to restart Xorg, if I wanted to accomplish that from the command-line? | 14:53 |
| fsmithred | restart slim | 14:54 |
| CueXXIII | from a remote login i would restart the login manager | 14:54 |
| Xenguy | service /usr/bin/slim restart | 14:55 |
| Xenguy | ? | 14:55 |
| CueXXIII | but first make sure no one on that machine uses x and has unsafed data | 14:55 |
| CueXXIII | unsaved | 14:55 |
| fsmithred | I haven't used slim in a long time. Does it restart cleanly or do you have to stop it and start it? | 14:55 |
| Xenguy | fsmithred, Will try and let you know | 14:55 |
| Xenguy | CueXXIII, single user machine here, but good point, thanks | 14:55 |
| fsmithred | service slim restart OR /etc/init.d/slim restart | 14:55 |
| CueXXIII | well, YOU might have unsaved data :) | 14:56 |
| Xenguy | true enough : -) | 14:56 |
| CueXXIII | thus i would simply wait till i'm at the desktop again | 14:57 |
| Xenguy | Ok, so this seemed to restart slim and thus Xorg: service slim restart | 14:58 |
| fsmithred | cool | 14:58 |
| Xenguy | Thanks for the feedback folks | 14:58 |
| Xenguy | I thought using 'init' would be a cool trick, but as you pointed out, it's a bit overkill | 14:59 |
| CueXXIII | also init 1 would kill your ssh session and sshd, so you can't issue init 2 remotely anymore | 15:00 |
| Xenguy | Not my use case, but point taken, it's rather a blunt instrument | 15:01 |
| rwp | Xenguy, Restarting slim with "service slim restart" will definitely restart X and present you with the slim graphical login. (Or lightdm if using lightdm.) | 17:16 |
| rwp | It used to be that the X terminate key was enabled by default. But due to pranks "Hey! Try this cool key combination!" and gullible people thinking they were their friend trying it caused it to be disabled by default. But it can be enabled. I always enable it. | 17:17 |
| rwp | If you set "setxkbmap -option terminate:ctrl_alt_bksp ... other options here I have -option compose:menu" then Control-Alt-Backspace will terminate X immediately. | 17:18 |
| rwp | At school with shared workstations that was used as rather a SAK Secure Access Key. https://en.wikipedia.org/wiki/Secure_attention_key | 17:19 |
| rwp | Hit that *before* logging into the graphical login manager (xdm) on shared workstations. Then be assured someone is not running a Trojan grabbing your login data. Then log into the system. | 17:19 |
| rwp | If running any of the X Display Managers (xdm) such as slim then when X terminates it will cycle back to the graphical login display allowing you to log in. | 17:20 |
| rwp | And if the xdm is configured in "kiosk mode" with an autologin configuration then it will automatically cycle you back to the running system. (It might just be me that calls that kiosk mode.) | 17:21 |
| Xenguy | rwp, MATE does have a function to 'log out' that I could assign, for example, Ctrl-Alt-Delete keybinding to, but I'm not clear whether 'log out' actually restarts Xorg (or even slim) | 18:43 |
| Xenguy | It would be nice to have C-A-D assigned to restarting Xorg though | 18:44 |
| fsmithred | alt-prntscr-k will kill xserver (magic sysrq) | 18:45 |
| fsmithred | or alt-sysrq-k if your keyboard says that | 18:45 |
| fsmithred | or if you need a function key with that (like my T420) | 18:46 |
| Xenguy | I have PrtSc here; what does 'sysrq' stand for? | 18:47 |
| fsmithred | sysrq stands for sysrq as in magic sysrq key | 18:48 |
| fsmithred | system request? | 18:48 |
| Xenguy | Ok, I've heard tell of that magic sysrq key sequence but never tried it myself | 18:48 |
| fsmithred | you say 'sequence' as if there's only one thing you can do with it. | 18:49 |
| fsmithred | but there's more | 18:49 |
| fsmithred | https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html | 18:50 |
| fsmithred | If you haven't used it then you aren't trying hard enough to fuck up your system. | 18:50 |
| Xenguy | I just tried alt-prtsc-k on the other laptop, and it quit X very quickly, then respawned slim (kind of similar to 'service slim restart' but perhaps there are differences under the hood) | 18:51 |
| fsmithred | I don't know the details. | 18:51 |
| Xenguy | haha, okay will have a look at that pointer when I get a chance, thanks | 18:51 |
| fsmithred | "the mechanism of action is unknown" -PDR | 18:51 |
| fsmithred | Xenguy, for all the keys to work, set the bitmask in /etc/sysctl.conf | 18:56 |
| fsmithred | kernel.sysrq=1 | 18:56 |
| fsmithred | default setting is kernel.sysrq=438 | 18:56 |
| Xenguy | fsmithred, hrm, that's a very interesting page indeed, will peruse that some more over brunch | 19:01 |
| fsmithred | Note that some of the keys don't work anyway. r-e-i-s-u-b can be just r-s-u-b so you don't have to see the message that e and i don't do anything. (if you're in console when you do it.) | 19:09 |
Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!