LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-06-2010, 10:23 AM   #1
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Rep: Reputation: Disabled
Post broadcast messages from server to clients


Hi there! I am searching for a way to broadcast a simple message from a server to the other machines (clients) on my local network every day at 22:30 (10:30pm) to warn users that the server will shutdown in 30 minutes (energy saving strategy). Basically, I was thinking to add a cron entry ion the server crontab to do so.

before I go ahead with that, I tried several ways to accomplish this action. I tried the wall command from the server with:

Code:
wall 'message'
but it says Wall: cannto find message (or something like that).

Then I tried simply "wall" and got a text promt to type in my message. At the end I pressed CTRL+D and got a popup displaying my message. So it worked but it was on the server's monitor. How can I send this message to a remote machine? Is wall the proper command to do so?

I also tried using paswordless ssh... It doesnt work. Basically I can login on the remote machine using passwordless ssh but when I issue either kdialog or xmessage, I get error "cannot connect to X server on diaplay 0:0" (or something similar).

I tried also ssh 'wall 'message'' but it also says "cannot connect to X server on diaplay 0:0"

So far I have several ways but nothing really works... There must be a real way to to that??

All machines are Slackware 13.1 based.
 
Old 07-06-2010, 11:58 AM   #2
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
I haven't dabbled in this but I remembered this thread which may help you out.

If you can manually (or scriptably) ssh into every box and run through every user on every box you can run
Code:
# XAUTHORITY=/home/user/.Xauthority DISPLAY=:0.0 xmessage "Hi"
as root (assuming /home/user/.Xauthority is used by default for every user), but that will only broadcast to :0.0 and only if that display is being used by user...obviously you could figure out a way to make the above work but it is not ideal and I think it would be better to find an application that can run as a server on each Slackware client and accept messages sent by your server. The linked thread has quite a few possibilities but it is a long read.
 
Old 07-07-2010, 07:13 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi

Look at the 'man shutdown' to see the time & warning-message for logged users;

Quote:
excerpt from 'man shutdown';

time When to shutdown.

warning-message Message to send to all users.

The time argument can have different formats. First, it can be an absolute time in the format
hh:mm, in which hh is the hour (1 or 2 digits) and mm is the minute of the hour (in two dig-
its). Second, it can be in the format +m, in which m is the number of minutes to wait. The
word now is an alias for +0.

If shutdown is called with a delay, it creates the advisory file /etc/nologin which causes pro-
grams such as login(1) to not allow new user logins. Shutdown removes this file if it is
stopped before it can signal init (i.e. it is cancelled or something goes wrong). It also
removes it before calling init to change the runlevel.
As for other members then look at woodsman's solution.

 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to receive DHCP broadcast messages? kornerr Programming 1 03-11-2009 02:31 AM
ssh console broadcast messages time112852 Linux - Software 2 11-23-2005 02:45 PM
Telnet Connections and broadcast messages CatSC Linux - Security 4 12-20-2004 11:53 PM
strange broadcast logging in messages file PennyroyalFrog Linux - Newbie 1 10-12-2004 09:37 PM
Receiving winpopup broadcast messages vrsic Linux - Software 8 10-30-2003 02:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:11 AM.

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