I'm trying to debug an issue with a SH script in my KDE autostart directory (~/.kde/Autostart). I'm running Scientific Linux 6.4 (kernel 2.6.32-754). The script simply launches an application. This application recently gained a new dependency for a library, and now the application will not start when launched via KDE Autostart because it complains it cannot find the library.

To try a manual fix, I simply put a symbolic link in /usr/lib64 pointing towards the library, which is an unconventional location, and that fixed the problem. But our machines are setup via an automatic installer which needs to correct the environment variables so this library shows up on the library path.

So I modified a script in /etc/profile.d which creates the environment variables for the user to add this directory with the library to the LD_LIBRARY_PATH for the user's profile. However, this did not fix the issue and the error is back. When I echo the LD_LIBRARY_PATH environment variable, I can clearly see that the directory has been added correctly, but KDE Autostart still doesn't seem to be able to see the library.

Looks like the /etc/profile.d script is only run when a terminal is opened to setup the environment, but those variables are not set when the KDE Autostart script runs. I echo'd out the LD_LIBRARY_PATH variable from my Autostart script and it's empty. Where should I be setting up the LD_LIBRARY_PATH for it to be available to Autostart? In .bashrc?

Is there something I'm missing? Does KDE Autostart execute these scripts as a user other than the profile where these Autostart scripts live? Or do they get their environment variables from elsewhere?

Let me know if there's any other information that would be helpful.

1 Answer 1


So since the user profile wasn't being loaded by the time the autostart script was executed, I discovered that you can place an env directory in ~/.kde with shell scripts that will set environment variables before your autostart scripts are executed. So I just explicitly declared the required library path here to solve the problem.

I also apparently needed to add a similar LD_LIBRARY_PATH line in my .xsession file in the user's home directory since apparently KDE Autostart scripts either don't get executed or the environment variables setup in ~/.kde/env don't apply to .xsession.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .