Sanity check in startkde

David Faure faure at kde.org
Mon Feb 2 08:05:49 GMT 2004


On Sunday 01 February 2004 14:44, Frans Englich wrote:
> 
> If a curious user runs startkde in his/her kde session - the sessions is 
> crashed.
> This can be fixed by doing a sanity check. There's two candidates:
> 
> 
> # check for already running KDE
> dcop kdesktop KDesktopIface isVRoot >/dev/null 2>/dev/null;
> if test "$?" = 0; then
>   echo "ERROR: KDE seems already running on this display."
>   xmessage -geometry 500x100 "ERROR: KDE seems already running on this 
> display."
>   exit 1
> fi
Looks fine to me. DCOP is per-display and this won't give false positives
with e.g. a stale lock file, it requires kdesktop to be actually running.

I think a isRunning or ping DCOP method would be better than misusing isVRoot.

> And:
> if test "$KDE_FULL_SESSION" = "true"; then
>   echo "ERROR: KDE seems already running on this display."
>   xmessage -geometry 500x100 "ERROR: KDE seems already running on this 
> display."
>   exit 1
> fi
This looks wrong. What if I'm starting a new X session from an existing one
(e.g. X -- :1 or whatever the syntax was) - the env. var will be inherited then, no?

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list