LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-12-2003, 03:47 PM   #1
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Rep: Reputation: 30
Announcing a restart to the Network


I'm running Linux as a server and I wish to announce when the system will be rebooting to the network. I have Windows users connecting via SMB and I wish to broadcast a message stating that the server will be rebooting in two minutes, please save all of your work now!

How could I do this? thank you.
 
Old 12-12-2003, 10:51 PM   #2
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
http://www.oreillynet.com/linux/cmd/...ath=s/shutdown
 
Old 12-13-2003, 08:57 AM   #3
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
Hi Darth,

Thank you. However, is that for a broadcast over a network?? I don't have the time right now to look at in close detail, but from the little I saw, it would appear that is for a user sitting at the Linux box. The message needs to be broadcast accross the network to my Windows clients. I'll take a closer look at it later, but are you sure that's what this is for?
 
Old 12-13-2003, 01:57 PM   #4
llamakc
Member
 
Registered: Nov 2003
Distribution: Debian & Ubuntu
Posts: 402

Rep: Reputation: 31
You can send popups with smbclient. I don't know the syntax but I worked in an environment where that was done. I think it was:

smbclient -M or something like that.
 
Old 12-13-2003, 02:44 PM   #5
downinthemine
Member
 
Registered: Jul 2003
Location: Silver Spring, MD
Distribution: Xubuntu
Posts: 167

Rep: Reputation: 30
The command is:

smbclient -M <name of computer you want to message>

You then get a prompt where you can enter your message

I only have one other computer on my network, so I am not sure whether you can enter multiple names at the command line or not.
 
Old 12-13-2003, 03:36 PM   #6
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
Very good. That worked. However, to run an automated message at a particular time??? Say, for example, the server will be rebooting in 5 minutes, save your work now!!

I want to shove that into cron 5 minutes before the server will restart. I started a script to do it. It's not working though. How would I automate this?? What has happened when I ran it is it runs the smbclient -M but does not send the message in the script. Perhaps I'll ask a friend of mine.

This is what I have so far. . . To force the system to do ctrl-d and send that message I'm not sure about. Any ideas?

-------------------------------------------------------------------------------------------------

# This script will send a winpopup message to the smbclients in your workgroup

smbclient -M hp-pavilion-pi

The Linux Server will be rebooting in 5 minutes. . . Please save all of your work now!!

Last edited by scottpioso; 12-13-2003 at 03:37 PM.
 
Old 12-14-2003, 02:52 PM   #7
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
Hi Everyone,

Well, I thought I would share with you my solution. If anyone has any better ideas, I'm all ears. This is what I did:

I made three separate text files (for 5 min, 3 min, and 1 min) for the different warnings. They are named:

restart5.txt
restart3.txt
restart1.txt

Then, I made 3 short shell scripts to execute them:

restart5.sh

# This script will send a WinPop message to the Windows Clients 5 minutes
# prior to restart.

cat restart5.txt | smbclient -M hp-pavilion-pi

restart3.sh

# This script will send a winpop to the Windows machines 3 min before restart

cat restart3.txt | smbclient -M hp-pavilion-pi

And so on. . .

Next I plugged the scripts into CRON to run at the appropriate times. Maybe that's a backwards way of doing it, but again, if someone else has any better ideas, I'm totally all ears!!
 
Old 12-14-2003, 03:02 PM   #8
llamakc
Member
 
Registered: Nov 2003
Distribution: Debian & Ubuntu
Posts: 402

Rep: Reputation: 31
You could wrap it into one script and use the at command and take it out of CRON.
 
Old 12-14-2003, 03:39 PM   #9
scottpioso
Member
 
Registered: Jan 2003
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473

Original Poster
Rep: Reputation: 30
Umm, how would I do that???
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
restart network zaicheke Slackware 2 12-30-2004 09:18 PM
Network not accessible after boot; OK after network restart chriswei Linux - Networking 5 09-22-2004 10:16 PM
Network Restart grim1234 Linux - Networking 2 06-08-2004 11:24 AM
Restart network Niphargus Linux - Networking 3 09-16-2002 11:42 AM
network restart 2kool Linux - Networking 1 02-06-2002 07:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:49 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
Open Source Consulting | Domain Registration