To stop the system with the shutdown(1M) command:
shutdown -gnwhere n is the number of minutes before the shutdown is to take place.
To go from normal operation to system maintenance mode, use this variation:
shutdown -gn isThe system displays a broadcast message at each terminal, prompting users to finish their work and log out.
For instructions on customizing the broadcast message see shutdown(1M).
Once all users are logged out or the specified time has elapsed, the system closes all accounts and displays this message:
The system has halted and may be powered off