logind: add .ScheduleShutdown and .CancelScheduledShutdown methods

System Internals / systemd - Daniel Mack [zonque.org] - 24 April 2015 10:48 UTC

Add a method called ScheduleShutdown in org.freedesktop.login1.Manager which adds a timer to shut down the system at a later point in time.

The first argument holds the type of the schedule that is about to happen, and must be one of 'reboot', 'halt' or 'poweroff'.

The second argument specifies the absolute time, based on CLOCK_REALTIME in nanoseconds, at which the the operation should be executed.

To cancel a previously scheduled shutdown, the CancelScheduledShutdown() can be called, which returns a bool, indicating whether a scheduled timeout was cancelled.

Also add a new property called ScheduledShutdown which returns the equivalent to what was passed in via ScheduleShutdown, as '(st)' type.

8aaa023 logind: add .ScheduleShutdown and .CancelScheduledShutdown methods
src/login/logind-dbus.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++
src/login/logind.c | 2 +
src/login/logind.h | 4 ++
3 files changed, 144 insertions(+)

Upstream: github.com


  • Share