Running a program automatically after loging in Fedora core 5
FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Redhat FC4, Fedora 8 and AIX 5.3, AIX 6.1
Posts: 39
Rep:
Hello Jonnyhashem,
You can do this one of to ways you can have init start the program for you by doing the following:
# who -r
run-level 5 2008-02-02 15:13 last=S
^^^^^^^^^^^ <- this tells you your current run level that you are in while you are in regular startup mode.
So if your who -r comes back as 5 then you will need to go to
cd /etc/rc5.d
Then in that did you will see several files that start with an S and K the S is for a start script and the K if for a kill script
you can look at them to see how the are formed really strait forward from a shell scritpitng point of view. So you will just need to create one of each for you prorgram and it will start and stop each time the run level is for run level 5 if you need for it to be at other run levels then you will go to the rc#.d dir and just copy your K and S scripts.
The other way which I have see several people do it is to just added the name of your program to their /home/<username>/.bash_profile
then just have it start that way because the shell will run the program for you if it is in the .bash_profile.
I would go with using init since that is really what its design to do.
To make a program run when you log in, simply make a link to it in the directory
~/.config/autostart
(~ means /home/<your username>/)
An example is have a file browser go to ~/.config/autostart then click on (in the gnome menu) Applications/Accessories and drag a menu item into that folder.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.