Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have been playing with Dbus (versions 1.4.0, in Ubuntu 10.10 and 1.4.14) and ConsoleKit (versions 0.4.1 and 0.4.5) to reboot or halt my computer without being a superuser. Everything works fine in both versions.

If I execute the commands detailed in this page, the systems halts or reboots without troubles. Now, what I'd like to know is whether I can schedule that halt/reboot at a certain time (still using Dbus/ConsoleKit). Something like the shutdown command can do (shutdown -h 10:56) Is that possible?

I can always use an at or cron, but if I can do it straight with dbus, that'd be perfect.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Calling halt, shutdown or reboot from the cron is cleaner solution, because d-bus is just messaging system, and cron already calls as a root. But if you need to tell about the shutdown to another applications thru d-bus, try calling this:

dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.