Sortix
Sortix Download Manual Development Source Code News Blog More
current nightly

Sortix cross-nightly manual

This manual documents Sortix cross-nightly. You can instead view this document in the latest official manual.

NAME

shutdown — shut down the computer

SYNOPSIS

shutdown [-Dhikpr] [time] [messages ...]

DESCRIPTION

shutdown gracefully powers off the computer at the specified time by waiting in the background and sending a request to the appropriate init(8) process.
The system is shut down immediately unless another time is specified:
now
Shutdown immediately.
+minutes[unit]
Shutdown after this many minutes. Optionally another unit can be specified with a s, sec, m, min, h, or hour suffix.
HH:MM
Shutdown at this time today, or tomorrow if in the past.
HH:MM:SS
Shutdown at this time today, or tomorrow if in the past.
YYYY-mm-dd HH:MM:SS
Shutdown at this time.
Countdown messages are broadcast using wall(1) with increasing frequency to warn users of the impending shutdown. Additional messages are included if specified, joined by spaces.
Further logins by non-privileged users are prohibited when 5 minutes or less remain by creating the /var/run/nologin file with the broadcast messages and an explanation.
The options are as follows:
-D
Run in the foreground rather than detaching a child process.
-h
Halt the operating system.
-i
Reinitialize the operating system.
-k
Broadcast the warning messages and create nologin but don't actually shut down.
-p
Power off the system. This is the default behavior.
-r
Reboot the system.

FILES

/var/run/nologin
Further non-privileged logins are prohibited if this file exists and users attempting to log in are shown the contents of this file.

ASYNCHRONOUS EVENTS

SIGINT
Cancels the pending shutdown and deletes the nologin file.
SIGTERM
Cancels the pending shutdown and deletes the nologin file.
SIGQUIT
Cancels the pending shutdown and deletes the nologin file.

EXIT STATUS

shutdown will exit 0 on success and non-zero otherwise. A child process continues running in the background as it waits for the scheduled shutdown.
The system will always shut down when the time comes if the parent process has exited successfully even if further errors occur while warning users.

SEE ALSO

wall(1), halt(8), init(8), login(8), poweroff(8), reboot(8)
Copyright 2011-2025 Jonas 'Sortie' Termansen and contributors.
Sortix's source code is free software under the ISC license.
#sortix on irc.sortix.org
@sortix_org