LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-26-2006, 01:45 PM   #1
AZaraT
LQ Newbie
 
Registered: Jun 2006
Posts: 16

Rep: Reputation: 0
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
 
Old 06-26-2006, 02:13 PM   #2
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,189

Rep: Reputation: 49
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.
 
Old 06-26-2006, 02:33 PM   #3
manishsingh4u
Member
 
Registered: Oct 2005
Location: Pune, India
Distribution: OpenSUSE 11.0
Posts: 422

Rep: Reputation: 30
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?

Last edited by manishsingh4u; 06-26-2006 at 02:48 PM.
 
Old 06-26-2006, 05:41 PM   #4
AZaraT
LQ Newbie
 
Registered: Jun 2006
Posts: 16

Original Poster
Rep: Reputation: 0
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?
 
Old 06-26-2006, 05:53 PM   #5
manishsingh4u
Member
 
Registered: Oct 2005
Location: Pune, India
Distribution: OpenSUSE 11.0
Posts: 422

Rep: Reputation: 30
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.
 
Old 06-26-2006, 06:12 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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.
 
Old 06-26-2006, 06:26 PM   #7
manishsingh4u
Member
 
Registered: Oct 2005
Location: Pune, India
Distribution: OpenSUSE 11.0
Posts: 422

Rep: Reputation: 30
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.

Last edited by manishsingh4u; 06-26-2006 at 06:28 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Start a daemon/program at boot SchwipSchwap Linux - Newbie 15 01-24-2006 02:58 AM
How do I start a program on boot ? overproof Mandriva 4 04-22-2005 08:13 AM
Start program at boot as non-root ImpactDNI Linux - Newbie 4 07-18-2004 01:44 PM
program start at boot moonloader Slackware 4 03-08-2004 07:33 AM
How to make a program start up on boot? daverino Linux - Newbie 1 02-22-2002 02:24 AM


All times are GMT -5. The time now is 03:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration