Skip to content

Commit

Permalink
feat: Set wall message
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthb committed Dec 17, 2024
1 parent e1a435f commit 8bb269a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions login1/dbus.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ func (c *Conn) ScheduleShutdown(typ ScheduleShutdownType, when time.Time) {
c.object.Call(dbusManagerInterface+".ScheduleShutdown", 0, typ.String(), when.UnixMicro())

Check failure on line 358 in login1/dbus.go

View workflow job for this annotation

GitHub Actions / Distro test (debian:bullseye)

when.UnixMicro undefined (type time.Time has no field or method UnixMicro)

Check failure on line 358 in login1/dbus.go

View workflow job for this annotation

GitHub Actions / Build on minimum supported toolchain

when.UnixMicro undefined (type time.Time has no field or method UnixMicro)

Check failure on line 358 in login1/dbus.go

View workflow job for this annotation

GitHub Actions / Distro test (ubuntu:20.04)

when.UnixMicro undefined (type time.Time has no field or method UnixMicro)

Check failure on line 358 in login1/dbus.go

View workflow job for this annotation

GitHub Actions / Distro test (ubuntu:22.04)

when.UnixMicro undefined (type time.Time has no field or method 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
Expand Down
12 changes: 9 additions & 3 deletions login1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

0 comments on commit 8bb269a

Please sign in to comment.