Show a Custom Message to Users Before Linux Server Shutdown

In a previous article, we explained the difference between shutdown, poweroff, halt and reboot Linux commands, where we uncovered what these mentioned commands actually do when you execute them with various options.

This article will show you how to send a custom message to all system users before shutting down a Linux server.

Suggested Read: tuptime – Shows Historical and Statistical Running Time of Linux Systems

As a system administrator, before you can shut down a server, you may want to send system users a message alerting them that the system is going. By default, the shutdown command broadcasts a message to other system users as shown in the screenshot below:

# shutdown 13:25
Linux Shutdown Broadcast Message
Shutdown scheduled for Fri 2017-05-12 13:25:00 EAT, use 'shutdown -c' to cancel.

Broadcast message for root@tecmint (Fri 2017-05-12 13:23:34 EAT):

The system is going down for power-off at Fri 2017-05-12 13:25:00 EAT!

To send a custom message to other system users before an in line shutdown, run the command below. In this example, the shutdown will happen after two minutes from the time of command execution:

# shutdown 2 The system is going down for required maintenance. Please save any important work you are doing now!
Linux System Shutdown Message
Linux System Shutdown Message

Supposing you have certain critical system operations such as scheduled system backups or updates to be executed at a time the system would be down, you can cancel the shutdown using the -c switch as shown below and initiate it at a later time after such operations have been performed:

# shutdown -c
Linux Shutdown Cancel Message
Shutdown scheduled for Fri 2017-05-12 14:10:22 EAT, use 'shutdown -c' to cancel.

Broadcast message for root@tecmint (Fri 2017-05-14 :10:27 EAT):

The system shutdown has been cancelled at Fri 2017-05-12 14:11:27 EAT!

Additionally, learn how to auto execute commands/scripts during reboot or startup using simple and traditional methods in Linux.

Don’t Miss:

  1. Managing System Startup Process and Services (SysVinit, Systemd and Upstart)
  2. 11 Cron Scheduling Task Examples in Linux

Now you know how to send custom messages to all other system users before a system shutdown. Are there any ideas you want to share relating to this topic? Use the comment form below to do that?

If this article helped, with someone on your team.

TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.
Check your email for a magic link to get started.
Something went wrong. Please try again.
TecMint has been free for 14 years. Help keep it that way.
Google AI Overviews and tools like ChatGPT have cut into search traffic for independent tech sites like TecMint. Running this site costs over $2,000 every month for hosting, infrastructure, and paying authors to keep the content accurate and tested.

If this article helped you solve a problem, consider buying a coffee. It helps keep TecMint free, supports the authors, and keeps the project going.
☕ Buy Me a Coffee
Aaron Kili
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

3 Comments

Leave a Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Free Course
Get a free Linux course before you go.
Subscribe to TecMint Weekly and get the Learn Linux 7 Days Crash Course free. Read by 34,000+ Linux professionals every Thursday.
Something went wrong. Please try again.
Check your email for a magic link to get started.