For stopping and restarting the system and changing over the user mode, use the shutdown(8) command.
Operation | Command |
---|---|
Stopping the system | shutdown -h now |
Restarting the system and changing over the user mode | shutdown -r now |
The user mode after restarting the system by the shutdown -r now command is specified by the following procedure. For run levels other than the below, see the OS manual.
For RHEL6 or earlier
As described in the table below, describe the user mode in the /etc/inittab file by using an editor including the vim(1), and then restart the system.
User mode | Description of /etc/inittab file |
---|---|
Multi-user mode | id:3:initdefault: |
Single user mode | id:1:initdefault: |
For RHEL7 or later
As described in the table below, change the run level by using the systemctl command, and then restart the system.
User mode | Run level |
---|---|
Multi-user mode | multi-user.target |
Single user mode | rescue.target |
Example: When restarting the system in single user mode
# systemctl set-default rescue.target # shutdown -r now |