I switched from starting my Openbox session with startx to xinit, and now my menu entries for poweroff and reboot are not working (I have a section in sudoers that allows my user to execute these commands without using sudo).
Additionally, the X info on the tty says that access is denied, but I'm not sure how this is happening since Openbox is started with the user I gave permission to shut down.
Does this have to do with some functional difference between startx and xinit? My main goal is to get shutdown and reboot working as menu items, but I'd like to know if using xinit actually can cause this.
All I know about startx is that it makes some preparations before running xinit (and I'm not going to study the script for you ). But I would not be surprised if your problem has something to do with you dropping startx -- which leads me to ask why you did that?
One other thing:
(I have a section in sudoers that allows my user to execute these commands without using sudo)
That does not make sense (but I think I've seen a comment like this before). The sudoers file specifies the security policy for sudo. If you're not using sudo, this policy is not too relevant.
If you didn't do anything crazy, you should be able to use `systemctl (reboot|poweroff)` without sudo, and in fact reboot and poweroff are symlinks to systemctl, so you can leave that 'systemctl' part off. Maybe that is how it worked before and maybe it stopped working because your logind session broke (perhaps you need startx for this). In that case, do some searching, you wouldn't be the first with session trouble.
With the sudoers thing, I put that in there because I wanted to be able to use those commands without requiring a password...unless I misunderstood how exactly it works. Which I think is what happened there. I've been able to poweroff and reboot as my regular user though, so maybe that has to do with the groups my user is in.
My reason for wanting to use xinit: I looked at pstree and saw that xinit branches from startx anyhow, I don't have any real need for an .xinitrc anyway, and trying xinit out looked like it boots a few seconds faster haha. Assuming I manage to fix this, I'd like to stick with xinit.
Also, the behavior is different from that of your provided thread, frank604. It doesn't freeze at shutdown, rather it doesn't do anything at all. Only after logging out of openbox-session do I see the "Access Denied" error amidst the rest of the X output. Thanks for trying though!