Gentoo Archives: gentoo-user

From: reader@×××××××.com
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: How to tell Cron X is running or not
Date: Mon, 26 Nov 2007 02:46:05
Message-Id: 87d4txrapj.fsf@newsguy.com
In Reply to: Re: [gentoo-user] How to tell Cron X is running or not by Andrey Falko
1 "Andrey Falko" <ma3oxuct@×××××.com> writes:
2
3 > How about something like this: retval=`ps aux | grep tty | grep X | awk
4 > '{print $2}'`
5 >
6 > Or retval=`cat /tmp/.X0-lock`
7 >
8 > Or even better:
9 >
10 > if [[ -e "/tmp/.X0-lock" ]];then
11
12 Yup, both of those should work from cron or anywhere. In my case and
13 probably many other as well, I could shorten the ps approach to:
14 ps aux|grep '[X] :0'
15
16 But looking for /tmp/.X0-lock is probably the most reliable. Thanks
17
18 --
19 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Re: How to tell Cron X is running or not felix@×××××××.com
Re: [gentoo-user] Re: How to tell Cron X is running or not Neil Bothwick <neil@××××××××××.uk>