Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm new to linux server administration, and I wonder how you would warn users that the system is going down for a restart.

According to LPIC1 Training here: http://www.ibm.com/developerworks/library/l-lpic1-v3-101-3/

There are 2 possibilities:

echo "I'm about to restart" |wall

or

shutdown 10 about to restart&

Are there any other ways to warn end users the system is about to reboot?

share|improve this question
    
Are the users you want to notify on terminal emulators (ssh, xterm, gnome-terminal, etc? If so, wall/shutdown is the best you can do. Unfortunately, if you are trying to get the attention of someone in a GUI, it's nearly impossible to guarantee they see it. For example, I'm in my browser now and if you were to ssh into my system and shutdown I might never see the notification because my 5 terminal windows are obscured. –  msw Jul 10 '13 at 0:12
add comment

2 Answers

up vote 2 down vote accepted

I think you can use tools like notify-send and zenity to send messages to GUI desktops when you're shutting down the system.

$ notify-send "System is going down in 10 minutes"

                      notify-send ss

$ zenity --info --text="System is going down in 10 minutes"

                                 zenity

References

share|improve this answer
add comment

Using wall either directly or by adding a message to shutdown is the standard way of doing it. Be sure to warn by wall some time in advanced, and let shutdowncount-down towards shutdown (eg. don't use shutdown -h now). I would say you should start shutdown at least 30-60 minutes before the actual shutdown, so the users gets fair warning. Shutting down on a specific time (e.g. at 3:00pm) is probably best.

If the shutdown is planned, it's usual to add information about it in /etc/motd - "message of the day", those few lines of text users gets after logging-in. If it's planned, sending out an email to users and/or posting information on the site's web-page, is also a good idea.

As the time for the shutdown approaches, the system can be set to not accept new log-ons by the presence of a file. I believe it's also possible to add an explanation (e.g. time when the system is expected to be back up again) to this file.

So in short, if possible give users advanced warning - and at least give them plenty of time to save their work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.