[KLUG Members] Huge KDE tip

Peter Buxton members@kalamazoolinux.org
Wed, 24 Jul 2002 17:03:49 -0400


--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


While researching KDE 3, I discovered the following: do

chown 0.0 /tmp/.ICE-unix=20
chmod 1777 /tmp/.ICE-unix

and KDE will start 5 seconds faster or more. And it did. It now beats
Sawfish on startup.

Why?

do 'ls -lA /tmp' and see:


total 44
drwxrwxrwt    2 root     root         4096 Jul 24 08:41 .ICE-unix
-r--r--r--    1 root     root           11 Jul 20 16:27 .X0-lock
drwxrwxrwt    2 root     root         4096 Jul 20 16:27 .X11-unix
drwx------    2 peter    peter        4096 Jul 24 08:40 kde-peter
drwx------    2 peter    peter        4096 Jul 24 08:41 ksocket-peter
drwx------    3 peter    peter        4096 Jul 24 08:41 mcop-peter
-rw-------    1 peter    peter         129 Jul 24 16:14 mutt-killdevil-1277=
7-1


The first three lines are the interesting ones:

-r--r--r--    1 root     root           11 Jul 20 16:27 .X0-lock

This is the X server's process ID number.

drwxrwxrwt    2 root     root         4096 Jul 20 16:27 .X11-unix

This is a directory which contains a socket for each X screen. Note that
its permissions are those of /tmp itself: read, write and search/execute
are on for user, group and other. Normally, this means that anyone can
rm or mv any file, but the sticky bit, 't', is set. This 'pushes' the
permissions down: in a sticky-bitted directory, even a world-writable
dir, only the file's owner (or root) can rm or mv that file. Obviously,
this is a good setting for /tmp, or /tmp/.X11-unix.

(Octally, the above directory is set to 1777.)

drwxrwxrwt    2 root     root         4096 Jul 24 08:41 .ICE-unix

Now this dir is the kicker. ICE is an event communications system now
standard in X11R4. KDE's interprocess communications (IPC), the Desktop
Communications Protocol (DCOP), is built on top of ICE, as SMTP is built
on top of TCP and NVT. This directory is, as above, a holder for
sockets, only for ICE sockets here instead of X screen sockets. However,
being rather new, most distro's don't seem to properly create this
directory (or, the X server will autocreate .X11-unix but not
=2EICE-unix). My system, for instance, had it owned by peter (to be
expected, as it was probably created by my KDE first time I ran it).


DCOP comes, interestingly, with an XML-RPC gateway that makes DCOP <->
XML-RPC about as simple as PHP. So any KDE app is a potential XML-RPC
client/server.

Info on Desktop COmmunications Protocol:

http://developer.kde.org/documentation/books/kde-2.0-development/ch13.html
http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interfa=
ce.html
http://developer.kde.org/documentation/tutorials/automation/index.html
http://developer.kde.org/documentation/library/kdeqt/dcop.html


--=20
http://killdevil.ath.cx/~peter (/gpg.html)
"Great, I exude sex appeal to my own sex."
 -- alt.tasteless, Zeno Gamble (str8)

--qDbXVdCdHGoSgWSk
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9PxY1aAK8ZwqLoskRAgjfAKCex2ATZJsii9HYTwkDFxSiGwcGWwCfbLW2
tmkX3d2qpbSEp1J2SNdHpsc=
=uL1t
-----END PGP SIGNATURE-----

--qDbXVdCdHGoSgWSk--