Announcement

Collapse
No announcement yet.

What PATH does KDE use? It doesn't use mine.

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] What PATH does KDE use? It doesn't use mine.

    My PATH is set in /etc/environment to have /usr/local/bin ahead of /usr/bin because I compile my own versions of some apps (not least vim and perl), but KDE doesn't want to know about that.

    If I don't put a full path in a kmenu entry, or use the Run Command... from the cashew, /usr/bin executables are found first.

    I'd set it in /etc/profile or .profile, but by the time they are run, the setting from /etc/environment has been applied.

    I thought that when KDE is started, it would read at least $HOME/.profile, and the PATH would apply from then.

    Regards, John Little

    #2
    Re: What PATH does KDE use? It doesn't use mine.

    what shell are you using? I recommend making either a .bashrc or .cshrc file in your $HOME, if you haven't already.
    # make install --not-war

    Comment


      #3
      Re: What PATH does KDE use? It doesn't use mine.

      Do
      Code:
      echo $PATH
      to find out.
      Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

      Comment


        #4
        Re: What PATH does KDE use? It doesn't use mine.

        Originally posted by russlar
        what shell are you using? I recommend making either a .bashrc or .cshrc file in your $HOME, if you haven't already.
        I use bash. I've instrumented the beginning of /etc/profile, ~/profile, and ~/.bashrc with
        Code:
        echo `date +%T.%N` .profile PS1="'$PS1'" >> $HOME/startup.log
        echo $PATH >> $HOME/startup.log
        and the result when I log in is:
        Code:
        21:00:53.299731496 /etc/profile PS1=''
        /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
        21:00:53.303627454 .profile PS1=''
        /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
        21:00:53.311548435 .bashrc PS1=''
        /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
        so you see that $PATH has indeed been set the way I want, by the time bash is running, so tinkering with bash startup files is not useful.
        Regards, John Little

        Comment


          #5
          Re: What PATH does KDE use? It doesn't use mine.

          I think this will go some way to see you right - taken from here http://www.faqs.org/docs/Linux-mini/Path.html

          What it boils down to is kdm (or gdm for that matter) mixing things up.

          The most important settings is possible to set in the global shell initialization files for login shells: /etc/csh.login for tcsh and /etc/profile for bash.

          Exceptions that do not get the right path from these files are rsh commands, ssh commands, menu items from X window manager that do not explicitly start login shell, commands invoked from inittab, cron jobs, daemons jobs like magic filters started from lprd, WWW CGI scripts, and so on.

          If the path is set in /etc/csh.cshrc, the path is right even when rsh or ssh execute command in remote machine with account using tcsh/csh. However, it is not possible to set path if account uses bash/sh.

          It is possible to combine path setting to one file, for example to a file /etc/environment-common. There we write:

          ${EXPORT}PATH${EQ}/bin:/usr/bin:/sbin:/usr/sbin:/usr/bin/X11:/usr/local/bin:/usr/games:.

          This can be used from /etc/csh.login (for tcsh and csh)

          set EQ=" " set EXPORT="setenv " source /etc/environment-common

          And from /etc/profile (for bash, doesn't work for ordinary sh)

          EQ='=' EXPORT="export " . /etc/environment-common

          And from /etc/environment (for XDM)

          EQ="=" EXPORT="export " . /etc/environment-common

          This strategy works mostly but ssh will complain of the lines in /etc/environment (and defined environment variables EQ and EXPORT). And still, rsh commands executed with bash won't get this path.
          Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

          Comment


            #6
            Re: What PATH does KDE use? It doesn't use mine.

            Originally posted by toad
            Do
            Code:
            echo $PATH
            to find out.
            echo $PATH shows the path I want, but if I use the cashew to run the command gvim, /usr/bin/gvim is run, not /usr/local/bin/gvim, which is before /usr/bin/gvim in the path.

            Getting bloody minded, I put my echo statements in startkde, and they run after the ~/.profile, and the path is indeed set the way I want. But kde is not using it; I imagine that the run command dialog sends a message to some other process where the path is different, or some other way of starting gvim is used, maybe a cache.

            Can anyone shed some light?
            Regards, John Little

            Comment


              #7
              Well, five years later, I had occasion to look at this again, and it has been fixed IMO, in Saucy. There was some chatter on the lists when lightdm was introduced; some people's systems broke because lightdm was replacing the path, with something minimal to suit itself. Anyway,
              • the default path is /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games; note /usr/local/sbin and /usr/local/bin present and ahead of the non-local ones, which was my original problem
              • setting the path in /etc/profile now has effect in KDE, as it should

              Regards, John Little
              Regards, John Little

              Comment

              Working...
              X