LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Adding programs to startup (https://www.linuxquestions.org/questions/linux-newbie-8/adding-programs-to-startup-184975/)

TheTweaker 05-23-2004 06:47 PM

Adding programs to startup
 
Ok I'm not a huge linux noob i know my linux but im still getting use to SuSE 9.0 after getting so use to Redhat 9.0. I have this program called Venrilo and it a server for Voice. like a Voice chat room. well me and my friend use it for games. And well i hate going to the terminal and typing /home/ventrilo/ventrilo_srv every time i restart my web server or every time I login. Is their anyway i can add this to the Boot up process? I know if you add some agrument at the end of the command that it could set it to run in the back ground. But I'd rather have it boot up and not half to worry about it at all. well Thanks!

cristiroma 05-24-2004 08:19 AM

make a shell script like this:

==========================
#!/bin/sh
/home/ventrilo/ventrilo_srv &
==========================

place it on /etc/rc.d/, make it executable via chmod +x and place a symbolic link in /etc/rc.d/rc3.d/ or whatever your runlevel is ( run 'runlevel' ). take for example links which are already there.

Needs polish, but hey, it's a start :))

Good luck.

TheTweaker 05-24-2004 06:13 PM

Well its a start...just one thing...dont know how to create a schell script...thats one thing i have yet to learn...and then as for the link how would i want to do that?

marghorp 05-24-2004 07:22 PM

Creating a shell script is easy:

use your favourite editor, like emacs:

emacs shell_script_name.sh

(it doesn't need to end in .sh, but it will help you recognize shell scripts)

Once in there (emacs):

type in the following lines:

#!/bin/sh (this tells linux, which language to use, in this case shell)
/directory/anotherdirectory/the_file_you_want_to_start_at_boot

This is it. You can also create multiple rows containing files, you wish to run. Just be sure to include the whole path to them, to avoid the not to be found.

As this is complete, just hit:

CTRL+X+S (hold ctrl, press x, and then press s(not holding x, holding only ctrl) will save
CTRL+X+C (will exit)

chmod +x shell_script_name.sh

copy this to the /etc/rc.d directory by

cp shell_script_name.sh /etc/rc.d

Then create a link to that file from your desired runlevel:

ln -s /etc/rc.d/shell_script_name.sh /etc/rc.d/rcX.d/some_name_of_your_choice

This should do it. Make sure you replace X in the line above with your desired runlevel.

Good luck! Peace!

TheTweaker 05-25-2004 01:01 AM

Well didnt work...ill just mess around with it...im sure ill get it sooner or later...Thanks All!

marghorp 05-25-2004 01:47 AM

no problem :)


All times are GMT -5. The time now is 01:17 PM.