# ['setfont', '/usr/bin/setfont', 'KBD_SETFONT'],
# ]
#else
-progs = [['kexec', '/usr/sbin/kexec', 'KEXEC'],
+progs = [['halt', '/sbin/halt', 'HALT'],
+ ['kexec', '/usr/sbin/kexec', 'KEXEC'],
+ ['poweroff', '/sbin/poweroff', 'POWEROFF'],
['reboot', '/sbin/reboot', 'REBOOT'],
- ['halt', '/sbin/halt', 'HALT'],
]
#endif // 0
foreach prog : progs
#if 0 /// UNNEEDED by elogind
# option('link-udev-shared', type : 'boolean',
# description : 'link systemd-udev and its helpers to libsystemd-shared.so')
-#
+#
# option('sysvinit-path', type : 'string', value : '/etc/init.d',
# description : 'the directory where the SysV init scripts are located')
# option('sysvrcnd-path', type : 'string', value : '/etc/rc.d',
# value : '/etc/rc.local')
# option('halt-local', type : 'string',
# value : '/usr/sbin/halt.local')
-#
+#
# option('quotaon-path', type : 'string', description : 'path to quotaon')
# option('quotacheck-path', type : 'string', description : 'path to quotacheck')
# option('kill-path', type : 'string', description : 'path to kill')
option('docdir', type : 'string', description : 'path where to install the documentation.')
option('htmldir', type : 'string', description : 'path where to install the HTML documentation.')
-# We have no systemd-shutdown binary, so we need 'halt' and 'reboot'
+# We have no systemd-shutdown binary, so we need 'halt', 'reboot' and 'poweroff'
option('halt-path', type : 'string', description : 'path to halt')
+option('poweroff-path', type : 'string', description : 'path to poweroff')
option('reboot-path', type : 'string', description : 'path to reboot')
#endif // 0
option('kexec-path', type : 'string', description : 'path to kexec')
# option('umount-path', type : 'string', description : 'path to umount')
# option('loadkeys-path', type : 'string', description : 'path to loadkeys')
# option('setfont-path', type : 'string', description : 'path to setfont')
-#
+#
# option('debug-shell', type : 'string', value : '/bin/sh',
# description : 'path to debug shell binary')
# option('debug-tty', type : 'string', value : '/dev/tty9',
# option('www-target', type : 'string',
# description : 'the address and dir to upload docs too',
# value : 'www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd')
-#
+#
# option('seccomp', type : 'combo', choices : ['auto', 'true', 'false'],
# description : 'SECCOMP support')
#endif // 0
HandleAction action;
const char* verb;
} action_table[_ACTION_MAX] = {
+ [ACTION_HALT] = { HANDLE_HALT, "halt" },
[ACTION_POWEROFF] = { HANDLE_POWEROFF, "poweroff", },
[ACTION_REBOOT] = { HANDLE_REBOOT, "reboot", },
+ [ACTION_KEXEC] = { HANDLE_KEXEC, "kexec", },
[ACTION_SUSPEND] = { HANDLE_SUSPEND, "suspend", },
[ACTION_HIBERNATE] = { HANDLE_HIBERNATE, "hibernate", },
- [ACTION_HYBRID_SLEEP] = { HANDLE_HYBRID_SLEEP, "hybrid-sleep" },
+ [ACTION_HYBRID_SLEEP] = { HANDLE_HYBRID_SLEEP, "hybrid-sleep" }
+ /* ACTION_CANCEL_SHUTDOWN is handled differently */
};
static int elogind_set_wall_message(sd_bus* bus, const char* msg);
switch (action) {
case HANDLE_POWEROFF:
- return run_helper(HALT);
+ return run_helper(POWEROFF);
case HANDLE_REBOOT:
return run_helper(REBOOT);
case HANDLE_HALT:
* sleeping processes to wake up, we have to tell them all
* by ourselves. */
if (w == INHIBIT_SLEEP) {
- send_prepare_for(m, w, false);
+ (void) send_prepare_for(m, w, false);
m->action_what = 0;
} else
m->action_what = w;
assert(w <= _INHIBIT_WHAT_MAX);
/* Tell everybody to prepare for shutdown/sleep */
- send_prepare_for(m, w, true);
+ (void) send_prepare_for(m, w, true);
delayed =
m->inhibit_delay_max > 0 &&