poweroff

From NetBSD Wiki

Jump to: navigation, search

Contents

Description

The poweroff(8) utility flushes the file system cache to disk, sends all running processes a SIGTERM, waits for several seconds for them to die, sends a SIGKILL to the survivors and, respectively, powers down the system. The action is logged, including entering a shutdown record into the login accounting file and sending a message via syslog(3).

Requirements

poweroff(8) needs either apm or acpi compiled in the kernel to power down the machine. If this is not the case, the system will halt and prompt for a reboot on the console.

apm is enabled by default in the GENERIC_LAPTOP kernel and acpi is enabled by default in GENERIC_MPACPI kernels.

Example

# poweroff

However, if you need to let regular users shutdown netbsd workstation, you have to give permission to do so, by setting proper mode values for poweroff:

# chmod a=rx,ugo+s /sbin/poweroff
$ poweroff

See also

View source code (Please report any bugs or suggestions here).

Personal tools