Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I allow a login script for one user in fedora? ~/.initrc doesn't seem to work, and I tried adding an executable to /etc/init.d but that's for all users (and it didnt work either anyway).

share|improve this question

migrated from Mar 29 '10 at 0:11

This question came from our site for professional and enthusiast programmers.

By login script do you mean something like .bash_profile for bash? – Jefromi Mar 28 '10 at 20:58

+1 for Dennis' answer; this should work for the shell logins (and if not, you'll want to check if the appropriate configuration file is being read/sourced at shell start up).

If you want to run something when a Fedora user logs into X (either Gnome or KDE), then you'll need to do something slightly different. If it's just for your user, you can (when you're running Gnome) use the System -> Preferences -> Sessions menu to set any items you want to run.

If you want to do this using a file, I think Gnome sources: ~/.config/autostart . The entries in here should be in FreeDesktop style. For example:

[Desktop Entry]

I'm not sure how to do this using KDE though...

share|improve this answer
I guess that's a virtual +1? – Dennis Williamson Mar 29 '10 at 1:24
The best I can do given my starting reputation! – Sarcas Mar 29 '10 at 1:40

Add a call to your script to the user's .bash_profile if the shell is Bash, .profile if the shell is sh or some others, .zshrc if zsh, .cshrc or .login for csh or .tcshrc if tcsh. Note that there is some overlap in these files that I haven't covered in which different shells can use the same startup files.

If you want to have the script start every time a shell is started, rather than just at login, you can use, for Bash for example, .bashrc

share|improve this answer


cd ~/.config/autostart




the command edits the folder from above - so have a look there if the script does not execute.

share|improve this answer

You must log in to answer this question.