FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 02-02-2010, 09:00 PM
Jobst Schmalenbach
 
Default Display a warning message at a certain time ?

cron and xmessage.


Jobst



On Tue, Feb 02, 2010 at 09:47:20PM +0100, Niki Kovacs (contact@kikinovak.net) wrote:
> Hi,
>
> I'm currently installing a CentOS 5 desktop as a public internet access
> point. The machine shuts down every day automatically at 22:30. Is there
> a way I can display a message in GNOME at 22:15 warning the user that
> the machine will shutdown in 15 minutes ?
>
> Any suggestions ?
>
> Niki Kovacs
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos

--
If builders built buildings the way Microsoft wrote programs, then the first woodpecker that came along would destroy civilization.

| |0| | Jobst Schmalenbach, jobst@barrett.com.au, General Manager
| | |0| Barrett Consulting Group P/L & The Meditation Room P/L
|0|0|0| +61 3 9532 7677, POBox 277, Caulfield South, 3162, Australia
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-02-2010, 10:30 PM
Robert Heller
 
Default Display a warning message at a certain time ?

At Tue, 02 Feb 2010 21:47:20 +0100 CentOS mailing list <centos@centos.org> wrote:

>
> Hi,
>
> I'm currently installing a CentOS 5 desktop as a public internet access
> point. The machine shuts down every day automatically at 22:30. Is there
> a way I can display a message in GNOME at 22:15 warning the user that
> the machine will shutdown in 15 minutes ?

I believe the shutdown command automagically generates warning. I would
*guess* that GNOME would have some applet that monitors these sorts of
warnings and creates popups.

>
> Any suggestions ?
>
> Niki Kovacs
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Download the Model Railroad System
http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows
heller@deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-02-2010, 11:04 PM
Frank Cox
 
Default Display a warning message at a certain time ?

On Tue, 2010-02-02 at 18:30 -0500, Robert Heller wrote:
> I believe the shutdown command automagically generates warning. I
> would
> *guess* that GNOME would have some applet that monitors these sorts of
> warnings and creates popups.

I haven't seen one, unless the user happens to have a gnome-terminal
window open, in which case a warning appears in that terminal.
Otherwise, not.

--
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-03-2010, 05:20 AM
Jobst Schmalenbach
 
Default Display a warning message at a certain time ?

That's only on terminals (tty's, xterm, console) OR if you have xconsole open.

jobst


On Tue, Feb 02, 2010 at 06:30:15PM -0500, Robert Heller (heller@deepsoft.com) wrote:
> At Tue, 02 Feb 2010 21:47:20 +0100 CentOS mailing list <centos@centos.org> wrote:
>
> >
> > Hi,
> >
> > I'm currently installing a CentOS 5 desktop as a public internet access
> > point. The machine shuts down every day automatically at 22:30. Is there
> > a way I can display a message in GNOME at 22:15 warning the user that
> > the machine will shutdown in 15 minutes ?
>
> I believe the shutdown command automagically generates warning. I would
> *guess* that GNOME would have some applet that monitors these sorts of
> warnings and creates popups.
>
> >
> > Any suggestions ?
> >
> > Niki Kovacs
> > _______________________________________________
> > CentOS mailing list
> > CentOS@centos.org
> > http://lists.centos.org/mailman/listinfo/centos
> >
> >
>
> --
> Robert Heller -- 978-544-6933
> Deepwoods Software -- Download the Model Railroad System
> http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows
> heller@deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/
>
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos

--
The road to wisdom is long, so pack a big lunch!

| |0| | Jobst Schmalenbach, jobst@barrett.com.au, General Manager
| | |0| Barrett Consulting Group P/L & The Meditation Room P/L
|0|0|0| +61 3 9532 7677, POBox 277, Caulfield South, 3162, Australia
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-04-2010, 02:09 PM
Niki Kovacs
 
Default Display a warning message at a certain time ?

Frank Cox a écrit :
>
> On second thought, a bash file calling zenity in a cronjob will be
> better. You can have zenity show any message you want in a window on
> the desktop and the only option available in that window can be "ok".
> kalarm would allow the user to change the alarm, and that's not what you
> want.

OK, I fiddled around with this, and here's what I got so far.

1) In an open GNOME session, when I launch GNOME terminal and type this:

$ zenity --info --text "Warning message!"

... I get exactly what I want.

2) When I put this line in a bash script (/usr/local/sbin/warning.sh)
and launch it from within Gnome Terminal, I get the same result (as
expected).

3) But when I add it to crontab like this :

# crontab -e

15 22 * * * /usr/local/sbin/warning.sh

... nothing happens at the given time (10:15 PM).

Any idea what's wrong here?
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-04-2010, 02:24 PM
"Geoff Galitz"
 
Default Display a warning message at a certain time ?

> 3) But when I add it to crontab like this :
>
> # crontab -e
>
> 15 22 * * * /usr/local/sbin/warning.sh
>
> ... nothing happens at the given time (10:15 PM).
>
> Any idea what's wrong here?


Any errors from a cron run go to your root mailbox (or whatever user's
crontab it is, when applicable). Check your root mailbox for an error, I'm
assuming the PATH to zenity is not set correctly. That is the usual culprit
in a case like this.


---------------------------------
Geoff Galitz
Blankenheim NRW, Germany
http://www.galitz.org/
http://german-way.com/blog/


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-04-2010, 02:38 PM
Niki Kovacs
 
Default Display a warning message at a certain time ?

Geoff Galitz a écrit :

> Any errors from a cron run go to your root mailbox (or whatever user's
> crontab it is, when applicable). Check your root mailbox for an error, I'm
> assuming the PATH to zenity is not set correctly. That is the usual culprit
> in a case like this.
>

No mail for root.

I googled quite some more, and I still have no clue for this. Here's
what I have so far :

# crontab -l
53 16 * * * export DISPLAY=":0.0" && /usr/bin/zenity --info --text "Test"

(yes, all on one line, the wrapping only comes from my mail client)

Still not working. Which leaves me clueless.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-04-2010, 02:42 PM
 
Default Display a warning message at a certain time ?

> Geoff Galitz a écrit :
>
>> Any errors from a cron run go to your root mailbox (or whatever user's
>> crontab it is, when applicable). Check your root mailbox for an error,
>> I'm assuming the PATH to zenity is not set correctly. That is the usual
>> culprit in a case like this.
>>
> No mail for root.
>
> I googled quite some more, and I still have no clue for this. Here's
> what I have so far :
>
> # crontab -l
> 53 16 * * * export DISPLAY=":0.0" && /usr/bin/zenity --info --text "Test"
>
> (yes, all on one line, the wrapping only comes from my mail client)
>
> Still not working. Which leaves me clueless.

I assume you've checked /var/log/cron, to make sure it ran.

On further thought, here's a nasty one: on that line, echo $PATH. I wonder
if you need all the X paths, and maybe LD_LIBRARY_PATH set, for zenity to
run.

mark

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-04-2010, 02:58 PM
Niki Kovacs
 
Default Display a warning message at a certain time ?

m.roth@5-cent.us a écrit :

>
> I assume you've checked /var/log/cron, to make sure it ran.

Yes, it looks so.

>
> On further thought, here's a nasty one: on that line, echo $PATH. I wonder
> if you need all the X paths, and maybe LD_LIBRARY_PATH set, for zenity to
> run.
>
I think I do grasp in theory what you suggest, but I wouldn't know how
to get it into practice.

Anyone got a working solution for this ?
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-04-2010, 03:08 PM
Niki Kovacs
 
Default Display a warning message at a certain time ?

m.roth@5-cent.us a écrit :

>
> I assume you've checked /var/log/cron, to make sure it ran.
>

I think the problem boils down to this :

"How can I run a graphical application from crontab ?"

I gave it a shot with a simple one (/usr/bin/gcalctool) and didn't
succeed either.

<rant>

Phew, how I hate having to jump through burning loops for performing
such a simple task.

</rant>

Niki
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 02:29 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org