This will happen if the wm is started from a script (some wms start from a script by default, I think xmonad does.) It will happen if the wm is switched to another wm. Some wms have that capability.
If the wm is jwm or icewm or openbox, wmexit will explicitly kill them anyway, but that is a workaround. In situations like starting from a script, it is impossible for wmexit to know what it needs to kill. Therefore, to shutdown reliably, it needs to then try to kill X.
This should work. Replace this:
Code: Select all
for i in xfce4-panel lxsession lxqt-session `cat /etc/windowmanager` jwm icewm openbox
Code: Select all
for i in xfce4-panel lxsession lxqt-session `cat /etc/windowmanager` jwm icewm openbox X Xorg
wmexit can not always know what needs to be killed.
from here pointed out by MochiMoppel.