acpid "xscreensaver-command -lock" not working until acpid is restarted
Sorry to bother everybody again, but I'm running into a mystery wrapped around a conundrum.
I believe this problem started with either yesterday (Wed Jun 27) or today's (Thu Jun 28) update (I'm running 64-current, did "slackpkg upgrade-all" ; "slackpkg install-new" and "slackpkg clean-system"). Again, I'm not 100% sure but it wasn't a problem during the Tue 26th update.
Anyways, here's the problem,
I've been using acpid to hibernate (when I push the power button) and lock my screen (when I close the lid on my laptop) for quite some time by setting my /etc/acpi/acpi_handler.sh:
1. "xscreensaver-command -lock" works fine on its own (me typing it in a virtual terminal)
2. restarting "acpid" via /etc/rc.d/rc.acpid restart DOES make the lid-closing method for "xscreensaver-command -lock" work successfully
I don't understand why #2 happens because acpid is running, started up by rc.M (I don't have a /proc/apm file either) and the power button for hibernate works. After all, if it was running and working successfully before without me changing anything, why would restarting it make it work?
The people of slackware's IRC channel on freenode said it may have to do with the events I've set, but as listed, the /etc/acpi/events/default file lists events=.* (and I've never touched the events folder) so I'm thinking it should pick up all events even if they have no command or action set to them.
Ok, I believe I've found what is happening (I haven't looked into the technical details, so I'll just go based off of the error messages and such).
First off, when I added in "&> /someplace/screensaver.log" to the xscreensaver-command portion in /etc/acpi/acpi_handler.sh, I got:
My reasoning for this is because when acpid is loaded, I get that message above. However, when I do check my environment variables for root, $DISPLAY is set to ":0.0" so I still pondered why it didn't load. But, as stated in my first post, I could use "xscreensaver-command -lock" successfully as root after logging in (and restarting acpid would also make it work successfully). Hibernation and rebooting of course would cause the same error message to pop up again.
Eventually I came to believe that the $DISPLAY variable is set after acpid is loaded, although I have no idea why it was working before until I saw a .Xauthority file in /root. No idea why it wasn't working now, but after switching to a different user to run the "xscreensaver-command -lock" command in /etc/acpi/acpi_handler.sh, it was working again. I hope this helps other people, and if I'm wrong about the whole /etc/profile thing, then I'm out of ideas, folks. :)
|All times are GMT -5. The time now is 03:45 AM.|