[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: best way to check for an active X session from a maintainer script?

On Tue, 11 Sep 2007 00:07:52 -0700, Steve Langasek <vorlon@debian.org> said: 

> So the current thought is to use

>    who | awk '{print $2}'|grep -q '^:[0-9]'

> to detect whether there are users logged in via X before restarting
> the display managers.

> Look reasonable?

        Umm. I am in X, right now.
__> who | awk '{print $2}'|grep -q '^:[0-9]'

        Do I need to be root?
__> sudo who | awk '{print $2}'|grep -q '^:[0-9]'

        So, this does not seem to work in all cases.

Everyone is entitled to my opinion.
Manoj Srivastava <srivasta@debian.org> <http://www.debian.org/~srivasta/>
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C

Reply to: