Shutdown from WindowMaker when using Xdm

Polytropon freebsd at edvax.de
Sat Jan 21 05:35:22 UTC 2017


On Fri, 20 Jan 2017 21:17:57 +0100 (CET), Marco Beishuizen wrote:
> Hi,
> 
> What is a good and clean way to shutdown the system from a windowmanager 
> (in my case WindowMaker), and using xdm? I did add a menuitem containing 
> "shutdown -p now", but then WM sometimes coredumps.

I did the same and connected it to a key combination for
covenience (Ctrl+Alt+Moon on Sun USB type 7 keyboard), and
the remaining visible shutdown messages never indicated
a coredump for me (and there is no .core file).



> So I get the 
> impression that this method isn't the best way to do it.

Basically there is no problem with this method, simply
because it is the _normal_ method. Maybe you can exchange
the parameter "now" for a small time value, so programs
have time to perform TERM before they get KILL.

Actually, my menu item (menu "Functions", item "System shutdown")
calls this command:

	xterm -class SHUTDOWN -fg black -bg red -e "shutdown -p now ; read DUMMY"

Maybe that adds the "little time" that is needed instead
of calling the shutdown program directly?

In any case, you can examine a possibly remaining core file
to find out what _really_ happened instead of guessing. ;-)



> Just exiting the 
> WM is possible, but then the system exits to the login screen, without the 
> possibility of shutting down from there.

You can put an xlogout-based button on xdm's login screen
(using the same configuration file that puts a xconsole
there) which performs the "shutdown -p now" action.



> So is there a clean way of shutting down from WM?

What you're doing _is_ a clean way. I'd recommend examining
why the core dump occurs. As I said, I'm doing this for years
(probably decades) and never saw such kind of problem.




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list