LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   start program on boot (https://www.linuxquestions.org/questions/linux-newbie-8/start-program-on-boot-458480/)

AZaraT 06-26-2006 01:45 PM

start program on boot
 
Hello there

Okay first of all i want to say that i know this question has been asked over and over again but i didn't happen to find a way to do it anywhere so i'm gonna try here.

I'm running suse linux 10.1 and i want to start a program on boot. i've tried with the boot.local thing but i cant really get it working, allso i read a place that boot.local loads before your network and such, and since its a server im running i will need to run the program after the network has been loaded.

anyway in the boot.local script i tried to add

./home/server/hlds/hlds_l/hlds_run -game cstrike + port 27015 +maxplayers 10 +ip xxx.xxx.x.xxx +map de_dust

But it doesn't work, do i need to write some script or something ?

Need some help here :)
Hope someone can help me

Kind regrats AzaraT

w3bd3vil 06-26-2006 02:13 PM

rc.local commands are executed after your network is up (atleast in RedHat)
try running the exact same command after you boot up first.
check your logs to see what error it shows while running your command.

manishsingh4u 06-26-2006 02:33 PM

You should put the code in boot.local itself. Alternatively you can
1) create a new script of your own with this command in it.
2) then copy it in /etc/init.d/ directory.
3) Make this script executable
Code:

chmod 755 /etc/init.d/yourscript
4) And use insserv to add it system startup
Code:

insserv /etc/init.d/yourscrtpt
-------------------
-------------------
Code:

./home/server/hlds/hlds_l/hlds_run -game cstrike + port 27015 +maxplayers 10 +ip xxx.xxx.x.xxx +map de_dust
Does this work when u run this code manually from command line? Anyway, why u have put that dot before /home?

AZaraT 06-26-2006 05:41 PM

Quote:

Originally Posted by manishsingh4u
Does this work when u run this code manually from command line? Anyway, why u have put that dot before /home?

no it doesn't work.. but when im loggin in im in the home dir allready and then its only /hlds/hlds_l/hlds_run i need to type, but do i need to get the command from the root or?

manishsingh4u 06-26-2006 05:53 PM

check if there are proper permissions set on /home/server/ and it's subdirectories by
Code:

ls /home/server -l
They should be something similar to
Code:

drwxr-xr-x  server users  421888 2006-05-24 14:54 directoryname
-rwxr-xr-x  server users  421888 2006-05-24 14:54 filename.ext

And if they are not then reset the permissinss, so that everyone could read these files
Code:

chmod -cR 0755 /home/server
Now try rebooting with above settings told previously.

jschiwal 06-26-2006 06:12 PM

SuSE doesn't use a /etc/rc.local file in booting up. Read through the "man 7 init.d" for a description on which files are sourced when you boot up, and how to write a /etc/init.d script to start at certain runlevels.

There is a /etc/init.d/skeleton file that you can base your script on. The header needs to contain a specially formatted comment for the chkconfig to be able to create links to your script in the appropriate /etc/init.d/rc.N runlevel directory.

The SuSE manual should also explain this.

manishsingh4u 06-26-2006 06:26 PM

Quote:

Originally Posted by jschiwal
SuSE doesn't use a /etc/rc.local file in booting up.

Correct. But, it has /etc/init.d/boot.local which serves the same purpose.
Quote:

Originally Posted by jschiwal
Read through the "man 7 init.d" for a description on which files are sourced when you boot up, and how to write a /etc/init.d script to start at certain runlevels.

insserv /etc/init.d/anyscript should work.


All times are GMT -5. The time now is 03:45 AM.