Article 6EMQ6 startxfce4 finds DISPLAY is already set, on freshly booted system

startxfce4 finds DISPLAY is already set, on freshly booted system

by
selfprogrammed
from LinuxQuestions.org on (#6EMQ6)
This is an intermittent problem. It can happen 2 times out of 7 startx.
When "startx" is invoked, sometime xfce4 start finds that DISPLAY is already set, and errors out, wrongly.

I have added the following instrumentation to the startxfce4 file, to log the problem.
It has been inserted to execute where the script finds that DISPLAY is already set.
Code:function debug_dump
{
local log=~/startxfce4.log
echo "DEBUG_DUMP: $0" | tee >> $log
echo "DISPLAY=($DISPLAY)=" | tee >> $log
echo "OPT param=$*" | tee >> $log
echo "XFCE4_SESSION_WITH_CK=$XFCE4_SESSION_WITH_CK" | tee >> $log
echo "SERVERRC=$SERVERRC" | tee >> $log
echo "CLIENTRC=$CLIENTRC" | tee >> $log
echo "XDG_CONFIG_HOME=$XDG_CONFIG_HOME" | tee >> $log
echo "BASEDIR=$BASEDIR" | tee >> $log
echo "XDG_DATA_DIRS=$XDG_DATA_DIRS" | tee >> $log
echo "XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS" | tee >> $log
echo "DISPLAY=$DISPLAY" | tee >> $log
echo "XDG_VTNR=$XDG_VTNR" | tee >> $log
echo "END_LOG\n"
}
It left this as a log today when startx failed again.
It appears there are two sessions logged.
Note that the first DISPLAY line uses =( )= as delimiters, the second does not.
startxfce4.log:
Code:DEBUG_DUMP: /usr/bin/startxfce4
DISPLAY=(:0)=
OPT param=
XFCE4_SESSION_WITH_CK=
SERVERRC=
CLIENTRC=
XDG_CONFIG_HOME=
BASEDIR=/home/user1/.config/xfce4/
XDG_DATA_DIRS=/usr/local/share:/usr/share
XDG_CONFIG_DIRS=/etc/xdg:/etc/kde/xdg:/etc/xdg
DISPLAY=:0
XDG_VTNR=8
DEBUG_DUMP: /usr/bin/startxfce4
DISPLAY=(:0)=
OPT param=
XFCE4_SESSION_WITH_CK=
SERVERRC=
CLIENTRC=
XDG_CONFIG_HOME=
BASEDIR=/home/user1/.config/xfce4/
XDG_DATA_DIRS=/usr/local/share:/usr/share
XDG_CONFIG_DIRS=/etc/xdg:/etc/kde/xdg:/etc/xdg
DISPLAY=:0
XDG_VTNR=8I have tried clearing it in /etc/profile
DISPLAY=
and that did not help.

DISPLAY was in an export stmt in /etc/profile, and currently that line has been edited to exclude DISPLAY from export. It is not set anywhere in /etc/profile anyway.

As this is first login after booting the system, where could it possibly be getting some value for DISPLAY ?
I want to check this location at shutdown, so I have to find out where it is kept.
I suspect there is not supposed to be one, but then I am back to question1.

When startx is tried a second time, it has succeeded.
After finding it set during the first failure, how is it finding DISPLAY to be cleared in the second.
I do not see any place where it is being cleared.

Where are system environmental variables set, how many are there.
If this was a user local environmental variable, I expect it would be more consistent, not so erratic.
Also, this is happening for two different users.

==============
>> grep DISPLAY /etc/*
>> grep DISPLAY /etc/*/*
Nothing obvious to me:
Code:/etc/lynx.cfg:.h2 DISPLAY_CHARSET_CHOICE
/etc/lynx.cfg:# DISPLAY_CHARSET_CHOICE and ASSUMED_DOC_CHARSET_CHOICE settings correspondingly.
/etc/lynx.cfg:#DISPLAY_CHARSET_CHOICE:*
/etc/lynx.cfg:# enabled if DISPLAY environment variable IS defined and
/etc/lynx.cfg:# then printer/downloader will be enabled if DISPLAY
/etc/lynx.cfg:# for viewing image content types when the DECW$DISPLAY logical
/etc/lynx.cfg:# viewing image content types when the DISPLAY environment variable
/etc/lynx.cfg:# defined when the user has the environment variable DISPLAY
/etc/lynx.cfg:# (DECW$DISPLAY on VMS) defined. If the NON_XWINDOWS environment
/etc/lynx.cfg:# user DOES NOT have the environment variable DISPLAY defined.
/etc/lynx.cfg:# variable DISPLAY defined *at program start*, and equivalent to FALSE
/etc/lynx.cfg:# $DISPLAY environment variable is set, else if NON_XWINDOWS then command
/etc/lynx.cfg:# is allowed only if $DISPLAY environment variable is not set, if absent or
/etc/lynx.cfg:#ENABLE_LYNXRC:DISPLAY:OFF
/etc/profile:# DISPLAY, May be fooling startx into thinking that x-windows is already running
/etc/profile:#export PATH DISPLAY LESS TERM PS1 PS2
/etc/slrn.rc:% WWW browser to use. Xbrowser is used when the DISPLAY environment variable
/etc/termcap:######## LCD DISPLAYS
/etc/termcap:# DISPLAY FUNCTION GROUP III
/etc/termcap:# This must be used with DISPLAY FUNCTION GROUP I or III

/etc/postfix/main.cf.default:import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY LANG=C POSTLOG_SERVICE POSTLOG_HOSTNAME
/etc/security/pam_env.conf:# Set the DISPLAY variable if it seems reasonable
/etc/security/pam_env.conf:#DISPLAY DEFAULT=${REMOTEHOST}:0.0 OVERRIDE=${DISPLAY}>> grep DISPLAY /etc/rc.d/*
was empty. Did not find anything.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments