Message: previous - next
Month: December 2011

Kdesu and $PATH

From: Darrell Anderson <humanreadable@...>
Date: Fri, 23 Dec 2011 20:09:21 -0800 (PST)
I ran into a stubborn twist.

On a couple of test machines I have both 3.5.10 and 3.5.13 installed. 3.5.10 is installed to /usr and 3.5.13 is installed to /opt/trinity.

This kind of setup would be similar to having KDE4 installed too. That is, this problem will be seen in those environments too.

I have /etc/profile.d scripts add /opt/trinity/bin to the beginning of the $PATH variable and startkde checks for that too.

All is well until using kdesu. Kdesu acts like su rather than su -.

Root therefore inherits the system default $PATH, which for root is quite limited and does not include /opt/trinity/bin. Nor are any /etc/profile.d scripts sourced because kdesu is not performing a simulated login like su -.

Therefore /usr/bin is first in the system $PATH for root and/opt/trinity/bin is not in that search path at all.

The 3.5.10 version of kate gets opened. The same thing will happen with KDE4.

I can overcome the problem by typing the full path of the app and adjusting shortcuts accordingly. For example, kdesu /opt/trinity/bin/kate. Doable but inconvenient.

Is there something obvious I am missing to get kdesu to inherit /opt/trinity/bin as the first directory in $PATH?