[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Determine if x is running
- From: redhat buglecreek com
- To: redhat-install-list redhat com
- Subject: Determine if x is running
- Date: Mon, 09 Feb 2009 15:21:24 -0700
I'm am writing a script that sets some various security settings on
Redhat Boxes. I would like to try to determine if a gui may be running
on the box the script is run on. If so, I would echo some additional
text to stdout that instructs the user that they may required to
manually perform some additional settings manually. Things having to do
with screen savers. Anyway, I thought about the following:
1. use the runlevel command or who -r to see if the system is in
runlevel 5. This seems flawed since the box may have been started in
runlevel 3 and the startx command may have been used. The commands would
show runlevel 3.
2. Check if the environment variable DISPLAY is set. If so, seems like
there is a good chance that they are running a gui. (maybe)
Is there a better way to check this that anyone can think of?
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]