diff --git a/login1/dbus.go b/login1/dbus.go index 8b85a32..90acc38 100644 --- a/login1/dbus.go +++ b/login1/dbus.go @@ -358,6 +358,10 @@ func (c *Conn) ScheduleShutdown(typ ScheduleShutdownType, when time.Time) { c.object.Call(dbusManagerInterface+".ScheduleShutdown", 0, typ.String(), when.UnixMicro()) } +func (c *Conn) SetWallMessage(message string, enable bool) { + c.object.Call(dbusManagerInterface+".SetWallMessage", 0, message, enable) +} + // Inhibit takes inhibition lock in logind. func (c *Conn) Inhibit(what, who, why, mode string) (*os.File, error) { var fd dbus.UnixFD diff --git a/login1/types.go b/login1/types.go index 7851b0b..6cda8f8 100644 --- a/login1/types.go +++ b/login1/types.go @@ -14,9 +14,15 @@ const ( ) const ( - SD_LOGIND_ROOT_CHECK_INHIBITORS = uint64(1) << 0 - SD_LOGIND_KEXEC_REBOOT = uint64(1) << 1 + // Request for weak inhibitors to apply to privileged users too. + SD_LOGIND_ROOT_CHECK_INHIBITORS = uint64(1) << 0 + // Perform kexec reboot if a kexec kernel is loaded. + SD_LOGIND_KEXEC_REBOOT = uint64(1) << 1 + // When SD_LOGIND_SOFT_REBOOT (0x04) is set, or SD_LOGIND_SOFT_REBOOT_IF_NEXTROOT_SET_UP + // (0x08) is set and a new root file system has been set up on "/run/nextroot/", + // then RebootWithFlags() performs a userspace reboot only. SD_LOGIND_SOFT_REBOOT = uint64(1) << 2 SD_LOGIND_SOFT_REBOOT_IF_NEXTROOT_SET_UP = uint64(1) << 3 - SD_LOGIND_SKIP_INHIBITORS = uint64(1) << 4 + // Skip all inhibitors. + SD_LOGIND_SKIP_INHIBITORS = uint64(1) << 4 )