Checking whether a script can open a display?

William O'Higgins william.ohiggins-H217xnMUJC0sA/PxXw9srA at public.gmane.org
Tue Mar 1 21:52:29 UTC 2005


I use a cron job to update the backdrop (root window) of my window
manager.  Sometimes I am not running X, however, and then my mail box
fills up with cron telling me that it cannot open display :0.0.  Is
there a way I can test whether I can open that display so I can quit
cleanly?

The reason that this has come up is that I have had a few reboots in the
past couple of months - always when I am not at home.  The only thing in
/var/log/messages is this:

Mar  1 14:41:56 hostname -- MARK -- 

# these happen every twenty minutes, like clockwork ;-) until I get a
# message like this:

Mar  1 14:59:09 hostname syslogd 1.4.1#16: restart.

And then there are all the ramblings of a reboot.  The first I hear
about it is if I was logged on via ssh and my terminal hangs, or I
see the emails from cron about being unable to open the display ('cause
X doesn't run by default).

Any pointers would be appreciated.  Thanks.
-- 

yours,

William

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://gtalug.org/pipermail/legacy/attachments/20050301/742050be/attachment.sig>


More information about the Legacy mailing list