LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-25-2009, 03:08 AM   #1
KFC123
Member
 
Registered: May 2009
Posts: 47

Rep: Reputation: 15
How to notify user about rebooting?


I know using "shutdown -k " will notify the user the system is going to shutdown in some times. But I found that if the user are not running terminal, no message will be sent. So how can we notify all active user no matter if they open terminal or not about the reboot/shutdown soon? Is it possible to popup a messagebox to do so?

Thanks
 
Old 06-25-2009, 03:36 AM   #2
KFC123
Member
 
Registered: May 2009
Posts: 47

Original Poster
Rep: Reputation: 15
Someone told me to use wall command, I try that and it works. However, how can I send a message to all of them every 5 minutes until 30 minutes pass? I am not familar with the script, is that any demo available? Thanks.

Last edited by KFC123; 06-25-2009 at 12:31 PM.
 
Old 08-19-2009, 06:17 AM   #3
mufy
Member
 
Registered: Oct 2004
Location: Kuwait
Distribution: Currently - AIX | Previously - RHEL 4 ES, FC 10
Posts: 206
Blog Entries: 4

Rep: Reputation: 30
How about putting your 'wall' command in to a script and using 'cron' to schedule the run?

You may find this link useful on 'cron'

Last edited by mufy; 08-19-2009 at 06:21 AM.
 
Old 08-19-2009, 06:32 AM   #4
pegwole
LQ Newbie
 
Registered: Dec 2005
Location: Indiana
Distribution: Crunchbang
Posts: 16

Rep: Reputation: 1
I use rwall, it's fairly easy. Simply create a text file, eg shutdown.txt, and use rwall like this:

Quote:
rwall (your host name) /home/you/shutdown.txt
Then the users will see a message like this

"The system will be shutting down in 20 minutes, please save all unsaved documents and log off" Or whatever message you want them to see.
 
Old 08-19-2009, 06:42 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by KFC123 View Post
Someone told me to use wall command, I try that and it works. However, how can I send a message to all of them every 5 minutes until 30 minutes pass? I am not familar with the script, is that any demo available? Thanks.
Code:
#!/bin/bash

for (( i=6; i>0; i--))
do
	let mins=i*5
	echo "System going down in $mins minutes"
	sleep 300
done
echo "System going down NOW!!!"
Use echo for testing and wall for real
 
Old 08-19-2009, 06:50 AM   #6
pegwole
LQ Newbie
 
Registered: Dec 2005
Location: Indiana
Distribution: Crunchbang
Posts: 16

Rep: Reputation: 1
I forgot to mention, the simplest of messages can be the most effective. If you don't mind me asking what sort of multi-user system are you running? Just a small home server with a few friends ssh'd in or somehting you plan on using for a small office? As mufy said, putting the wall, or rwall command in a simple bash script and running it through cron would be good, but if you don't need to regularly reboot or shutdown then using the command I gave would work nicely. A friend of mine has a server that I have sudo access on, since it rarely needs to go down I don't really have much need to use cron, I just issue the command.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
notify user space application from the kernel space lordofring Linux - Software 2 06-22-2009 01:32 PM
Workarea Issue - - Notify user with status sahil.jammu Linux - Newbie 1 04-03-2009 09:24 AM
Rebooting into single user mode with a virtual box desertfox858 Linux - Newbie 2 03-07-2009 03:42 PM
how to re-initialize user space applications without rebooting sanyals Linux - Kernel 2 02-20-2007 07:03 AM
Notify user of event through enlightenment/X11 Quantum0726 Linux - Software 5 07-25-2005 10:28 PM


All times are GMT -5. The time now is 08:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration