LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   su program problem (https://www.linuxquestions.org/questions/linux-software-2/su-program-problem-302768/)

xaos5 03-17-2005 10:39 AM

su program problem
 
back again... proably a simple problem to fix but can't find a solution. when I want to launch a simple program lets say kwrite it will launch fine in konsole but If I do it as root by doing su it says it can't find it. This problem came up when I started using kdesu in kde.

su
password: *******

kwrite
bash: kwrite: command not found

launches fine when not superuser and using kdesu.

when backed out from kde into the shell and do su it works fine, its only in kde I have the problem.

slack 10.1 kde 3.3.2

Linux~Powered 03-17-2005 10:43 AM

Sounds like it's not in root's path. Try...

Code:

whereis kwrite
And then as root, run...

Code:

echo $PATH
To see if it is in fact in root's path.

xaos5 03-17-2005 10:49 AM

root has nothing for /opt/kde/bin/kwrite
how would I go about adding /opt/kde/bin/ to root's path???

sorry but i've only been using linux for a month or two now.

reddazz 03-17-2005 10:50 AM

If you use "su", you don't inherit roots path, so you may have to type the absolute path e.g. /opt/kde/bin/kwrite. If you use "su -", then you inherit everything.

xaos5 03-17-2005 10:57 AM

su -
that command works as it sees kwrite and others, but now its saying cannot connect to X server.

reddazz 03-17-2005 11:50 AM

Yeah that sometimes happens, because on some systems, you are not allowed to run GUI programs unless you are the user who started the X session. A work around would be to use "kdesu" or do the following as the user who is logged in
Code:

$xhost +localhost
$su -c "kwrite"

Substitute localhost for your own host name if you are using anything other than localhost as your host name.

xaos5 03-17-2005 01:02 PM

oops can't work on it to much more now because I messed up inittab file so it won't let the system boot, trying to get my knoppix cd working but its not liking me right now, if only older computers where easier to use.


All times are GMT -5. The time now is 05:21 AM.