Hans, Delz,
        the question is not exactly moot - there *are* instances when
sending a message to all the logged in users is very valuable. For old
style tty terminals there is a "wall" command that does exactly what Delz
wants, for X terminals we need xmessage, the way Hans points out.
        Here is what I use (I call it "wallx"):

#!/bin/bash
users=$(who | awk '{print $1}')
for     user in $users
do
        display=$(who | grep ^"$user" | awk '{print $2}')

#uncomment the following line and comment out next if access_control
        #su $user 2>/dev/null -c "xmessage -center -timeout 30 -display
$display $user, please log out now"&

        xmessage -center -timeout 30 -display $display $user, please log
out now 2>/dev/null &
done
#end sript

notice that i use direct xmessage, because i have disable_access_control=y
in lts.conf, so concievably, i could get away with just one run of "who"
        good luck, julius

On Tue, 3 Dec 2002, Hans Ekbrand wrote:

> On Tue, Dec 03, 2002 at 02:23:39PM +0800, Delz wrote:
> > Hi,
> >
> > Is there a program let's say I want to reboot the LTSP server and I want all
> > my users to see a message popping on their screen that saids the server will
> > reboot in 5 mins. Some sort of a warning message that will alert them, I
> > want an easier way of alerting them so that it will eliminate myself from
> > calling each user on the phone that the server will reboot in 5 mins. It
> > gets a little tiring sometimes when I have to call all 55 users that the
> > server will reboot.
>
> First, it sound like you reboot too often. AFAIK only kernel updates
> and hardware changes needs rebooting (after major software upgrades it
> can be wise to reboot just to ensure that the system will reach a good
> state after a reboot)
>
> Secondly, why not reboot when no users are working, e.g. in the night,
> or if that is not possible, when so few users as possible are working
> (use who to see who's in). (This of, course requires that users
> usually logs out when they are leaving or not using their terminals
> for a long period of time).
>
> Thirdly, I know of no program that will what you want without some
> hacking. There is utility called xmessage, that could be scripted to
> do something like this. xmessage must be run as the user who owns the
> Xserver, so a script that runs as root and for every user does
> something like this:
>
> su $user -c xmessage -center -display $screen "will reboot in 5 minutes"
>
> where $user and $screen are the first two columns of output of the who
> command.



-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET 
comprehensive development tool, built to increase your 
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.openprojects.net

Reply via email to