libera/#devuan/ Saturday, 2024-09-14

XenguyHi 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
XenguyI 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
fsmithredoh yeah, init 1, then ctrl-d14:51
XenguyFor example, would running 'init 1' (dropping to single user mode), and then running 'init 2' work?14:51
XenguyOh, hrm, interesting14:52
fsmithredwell, to issue init 2 you would first need to enter root password14:52
CueXXIIIyou just need to log out an in again, your disply manager restarts X for each new login14:52
fsmithredyeah, you don't really need to restart all the services14:53
XenguySo humor me, what would be the cleanest/simplest way to restart Xorg, if I wanted to accomplish that from the command-line?14:53
fsmithredrestart slim14:54
CueXXIIIfrom a remote login i would restart the login manager14:54
Xenguyservice /usr/bin/slim restart14:55
Xenguy?14:55
CueXXIIIbut first make sure no one on that machine uses x and has unsafed data14:55
CueXXIIIunsaved14:55
fsmithredI haven't used slim in a long time. Does it restart cleanly or do you have to stop it and start it?14:55
Xenguyfsmithred, Will try and let you know14:55
XenguyCueXXIII, single user machine here, but good point, thanks14:55
fsmithredservice slim restart OR /etc/init.d/slim restart14:55
CueXXIIIwell, YOU might have unsaved data :)14:56
Xenguytrue enough : -)14:56
CueXXIIIthus i would simply wait till i'm at the desktop again14:57
XenguyOk, so this seemed to restart slim and thus Xorg:  service slim restart14:58
fsmithredcool14:58
XenguyThanks for the feedback folks14:58
XenguyI thought using 'init' would be a cool trick, but as you pointed out, it's a bit overkill14:59
CueXXIIIalso init 1 would kill your ssh session and sshd, so you can't issue init 2 remotely anymore15:00
XenguyNot my use case, but point taken, it's rather a blunt instrument15:01
rwpXenguy, 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
rwpIt 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
rwpIf 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
rwpAt school with shared workstations that was used as rather a SAK Secure Access Key.  https://en.wikipedia.org/wiki/Secure_attention_key17:19
rwpHit 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
rwpIf 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
rwpAnd 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
Xenguyrwp, 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
XenguyIt would be nice to have C-A-D assigned to restarting Xorg though18:44
fsmithredalt-prntscr-k will kill xserver (magic sysrq)18:45
fsmithredor alt-sysrq-k if your keyboard says that18:45
fsmithredor if you need a function key with that (like my T420)18:46
XenguyI have PrtSc here; what does 'sysrq' stand for?18:47
fsmithredsysrq stands for sysrq as in magic sysrq key18:48
fsmithredsystem request?18:48
XenguyOk, I've heard tell of that magic sysrq key sequence but never tried it myself18:48
fsmithredyou say 'sequence' as if there's only one thing you can do with it.18:49
fsmithredbut there's more18:49
fsmithredhttps://www.kernel.org/doc/html/latest/admin-guide/sysrq.html18:50
fsmithredIf you haven't used it then you aren't trying hard enough to fuck up your system.18:50
XenguyI 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
fsmithredI don't know the details.18:51
Xenguyhaha, okay will have a look at that pointer when I get a chance, thanks18:51
fsmithred"the mechanism of action is unknown" -PDR18:51
fsmithredXenguy, for all the keys to work, set the bitmask in /etc/sysctl.conf18:56
fsmithredkernel.sysrq=118:56
fsmithreddefault setting is kernel.sysrq=43818:56
Xenguyfsmithred, hrm, that's a very interesting page indeed, will peruse that some more over brunch19:01
fsmithredNote 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/!