Home Linux Using Shutdown Command in Linux

Using Shutdown Command in Linux

shutdown may be used to halt, power-off or reboot the machine. The first argument may be a time string (which is usually “now”). Optionally, this may be followed by a wall message to be sent to all logged-in users before going down. The time string may either be in the format “hh:mm” for hour/minutes specifying the time to execute the shutdown at, specified in 24h clock format.

Alternatively it may be in the syntax “+m” referring to the specified number
of minutes m from now. “now” is an alias for “+0”, i.e. for triggering an immediate shutdown. If no time argument is specified, “+1” is implied.Note that to specify a wall message you must specify a time argument, too. If the time argument is used, 5 minutes before the system goes down the /run/nologin file is created to ensure that further logins shall not be allowed.

Shutdown A Server

shutdown -h now

The Command is going to power off your system instantly without further delays. This is useful when you want to power off your machine

Rebooting Your Server

shutdown -r now

Like shutdown it will instantly restart your server without further delays.

Time Specified Reboot

shutdown -r +5

It will trigger reboot after 5 minutes. Till then all users on the machine have option to safely close their work and message will be broadcasted for all users too.

Cancel Reboot or Shutdown

shutdown -c

This will cancel all pending shutdown or reboot task triggered on shell.

Must Read

Routing Domain Name in Haproxy

I hope you are following the below guide. Now suppose you want to route domain name to open specific backend that have...

Enable Logging in Haproxy

HAProxy can emit log message for processing by a syslog server. This is compatible with familiar syslog tools like Rsyslog, as well...

Getting real IP in Nginx when behind cloudflare Haproxy

Create a file named cloudflare_ips.ls and in that add all the cloudflare IP's vi /etc/haproxy/cloudflare_ips.ls 173.245.48.0/20 103.21.244.0/22 103.22.200.0/22 103.31.4.0/22 141.101.64.0/18 108.162.192.0/18 190.93.240.0/20 188.114.96.0/20 197.234.240.0/22 198.41.128.0/17 162.158.0.0/15 104.16.0.0/12 172.64.0.0/13 131.0.72.0/22 2400:cb00::/32 2606:4700::/32 2803:f800::/32 2405:b500::/32 2405:8100::/32 2a06:98c0::/29 2c0f:f248::/32

Getting Real IP in HaproxyNginx configuration

Well its a little configuration can get real to nginx when haproxy is set as reverse proxy. Follow this...

Haproxy as Single Point to Failure Node With Glusterfs and MariaDB Maxscale Cluster

HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It...