LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   automatically startup a program after booting? (https://www.linuxquestions.org/questions/linux-software-2/automatically-startup-a-program-after-booting-186751/)

caicai 05-27-2004 09:38 PM

automatically startup a program after booting?
 
Hi,

I want to automatically startup some program after booting my Red Hat, say, evolution, how to config any files?

Thanks

shaggz 05-27-2004 10:01 PM

Most of your startup scripts will be in /etc/rc.d/rcX.d where X = the runlevel it is started and or Killed in.


Lets say you have a script called startme in your home directory and you wanted it to run at runlevel 3.

You could simply copy the script over to /etc/init.d then create a symlink to that in /etc/rc.d/rc3.d as follows.


[root@blackrain /usr/bin]# cp ~/startme /etc/init.d/startme
[root@MARS /usr/bin]# ln -s /etc/init.d/startme /etc/rc3.d/S99startme


This should do the trick for you. Just make sure that if it is a script that accesses a service such as apache that you put it in a runlevel after apache so apache will be running.


Hope this helps.

critch 05-27-2004 10:31 PM

to automatically start an application...
 
I believe the last post is not quite what you WANT to do if you are looking to start an APPLICATION automatically.

If you use KDE (Red Hat default is Gnome), simply copy the desktop icon to the ".kde/autostart" directory.

If you want to autostart in application in any X windows system (Gnome or KDE), I think all you have to do is add a line to your ".profile" script (in your home directory). In your case adding the line "evolution" should do it.

I hope this helps.

shaggz 05-28-2004 12:11 AM

Good call critch I think I may make things too hard for myself at times eY.


Cheers

: >

caicai 05-28-2004 01:54 PM

Hi,

Thank you guys for replying. I have found a different solution which is checking the "Save current setup" when logging off, and then I will have the same environment as before after relogging in.

mjjzf 07-06-2004 02:24 PM

Yes, but restoring the environment is quite a capacity-consuming thing. Better to link to an autostarting app than restoring the environment - that also means you have to set up the environment the exact way you want it when you log off?

kodaku 08-12-2004 03:51 AM

Quote:

Originally posted by shaggz
Most of your startup scripts will be in /etc/rc.d/rcX.d where X = the runlevel it is started and or Killed in.


Lets say you have a script called startme in your home directory and you wanted it to run at runlevel 3.

You could simply copy the script over to /etc/init.d then create a symlink to that in /etc/rc.d/rc3.d as follows.


[root@blackrain /usr/bin]# cp ~/startme /etc/init.d/startme
[root@MARS /usr/bin]# ln -s /etc/init.d/startme /etc/rc3.d/S99startme


This should do the trick for you. Just make sure that if it is a script that accesses a service such as apache that you put it in a runlevel after apache so apache will be running.


Hope this helps.

Well this method seems to fit my needs but the question is if I don't have a scripts call startme then WHAT shall I do ? how to write a shell script to "shell" a program ?

kodaku 08-12-2004 07:16 AM

I did as what shaggz said but still can't start it!! somebody tell me what seems to be the problem???


All times are GMT -5. The time now is 07:51 AM.