Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Mar 29 '10 at 0:11

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

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

3 Answers

folder:

cd ~/.config/autostart

from http://cholla.mmto.org/computers/linux/session.html

shell-command:

gnome-session-properties

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

share|improve this answer
add comment

+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]
Type=Application
Name=Pidgin
Exec=pidgin
Icon=
Comment=

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 comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.