I installed nodm, so that Debian starts Xorg and a window manager immediately after booting, without requesting any password and without a login.

How can I similarly setup Debian to shutdown the system automatically, without password prompt, whenever the window manager and Xorg are quit?

  • 1
    You'd have to somehow monitor the xorg server/daemon and run shutdown when it quits. As to how you go about this, I don't know. Perhaps something in an X config file could issue that command on termination. Perhaps even in ~/.bash_logout (assuming the default user for nodm is logged out when xorg quits). – Agi Hammerthief Sep 18 '14 at 15:45
  • I think you will find varying avenues based on how the system is shutdown. If a window-manager application is doing it, there will be fewer places to look for a script that can be tuned. If procs are being shutdown by a hot-key or even command line, different options available. – rhoyerboat Dec 5 '14 at 15:34

Use a displaymanager, which supports scripts like Xreset and Xsession, for example kdm and configure it for auto login.

$ head -n5 /etc/kde4/kdm/Xreset 
#! /bin/sh
# Xreset - run as root after session exits

# Reassign ownership of the console to root, this should disallow
# assignment of console output to any random users's xterm. See Xstartup.

There you can place the shutdown command. Have a look at lightdm, maybe even xdm, if they support such scripts, too. maybe even nodm does.

|improve this answer|||||
  • nodm runs the user session using Xsession script; I haven't specifically checked its reset behaviour, but I'd be surprised if this didn't work. – Toby Speight Jul 15 '15 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.