Hi everybody, sorry for my English!
I need to shutdown a computer using a PHP script.
If I execute 'sudo /sbin/shutdown -h now' it works, but I would like to use '/usr/bin/gnome-power-cmd.sh shutdown' to let Gnome power manager handle the event.
People say that this is the right way, to avoid filesystem corruptions and so on..
But '/usr/bin/gnome-power-cmd.sh' uses D-Bus to send the command to the power manager and it seems that PHP (Apache module) doesn't have access to the D-Bus session (the Gnome-power-manager one) because it says: "Failed to open connection to session message bus: dbus-launch failed to autolaunch D-Bus session: Autolaunch error: X11 initialization failed."
Well, I know nothing about D-Bus..
Someone knows a way to get it working?
Bookmarks