LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 07-26-2005, 01:59 AM   #1
ps2cho
Member
 
Registered: Jun 2005
Posts: 36

Rep: Reputation: 15
gentoo deamon


Quote:
#!/sbin/runscript

start() {
ebegin "Starting Half Life Dedicated Server 1"
/home/ps2cho/hlds_1/hlds_run -game czero +port 27015 +maxplayers 13 +ma$
eend $?

}

stop() {
ebegin "Stopping Half Life Dedicated Server 1"
killall hlds_run
eend $?
}
This is my created init.d script...
but it doesnt work.

hlds_run works when i do:

./hlds_run -game etc....

how would i make it so that the script works with that?
 
Old 07-27-2005, 11:19 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
I think you need a line like:
Code:
opts="start stop"
Also, what happens if you run the init script from the console?
 
Old 07-27-2005, 11:47 AM   #3
ps2cho
Member
 
Registered: Jun 2005
Posts: 36

Original Poster
Rep: Reputation: 15
It says file cannot be found
 
Old 07-27-2005, 12:16 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Did you run it like running any other init script?
 
Old 07-27-2005, 08:15 PM   #5
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Did you make the file execuatble? chmod +x filename
 
Old 07-28-2005, 02:17 AM   #6
ps2cho
Member
 
Registered: Jun 2005
Posts: 36

Original Poster
Rep: Reputation: 15
yes to both.
 
Old 07-28-2005, 09:00 AM   #7
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Ok, when running it, what output do you get?
 
Old 07-28-2005, 12:26 PM   #8
ps2cho
Member
 
Registered: Jun 2005
Posts: 36

Original Poster
Rep: Reputation: 15
Quote:
server ~ # /etc/init.d/hlds_1 start
* Starting hlds_1... ...
/etc/init.d/hlds_1: line 5: /home/ps2cho/hlds_1/hlds_run -game czero +port 27015 +maxplayers 13 -pingbooster 3: No such file or directory [ !! ]
It is though cos for me to start it manually i do:

#cd /home/ps2cho/hlds_1
#./hlds_run -game czero +port 27015 +maxplayers 13 -pingbooster 3

Last edited by ps2cho; 07-28-2005 at 12:27 PM.
 
Old 07-28-2005, 12:31 PM   #9
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Try having your init script do it exactly like you do, or vice versa. From the console NOT in the hlds_1 directory, do
Code:
/home/ps2cho/hlds_1/hlds_run -game czero +port 27015 +maxplayers 13 -pingbooster 3
or change the init script to do:
Code:
cd /home/ps2cho/hlds_1
./hlds_run -game ...
 
Old 07-28-2005, 12:54 PM   #10
ps2cho
Member
 
Registered: Jun 2005
Posts: 36

Original Poster
Rep: Reputation: 15
Tried that, it says that the cd /home etc... line is invalid.
 
Old 07-28-2005, 01:08 PM   #11
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
It says the line is "invalid"?
 
Old 07-28-2005, 02:00 PM   #12
ps2cho
Member
 
Registered: Jun 2005
Posts: 36

Original Poster
Rep: Reputation: 15
Quote:
server ~ # /etc/init.d/hlds_1 start
/etc/init.d/hlds_1: line 11: unexpected EOF while looking for matching `"'
/etc/init.d/hlds_1: line 15: syntax error: unexpected end of file
* ERROR: "/etc/init.d/hlds_1" has syntax errors in it; not executing...
Well its giving this now...

here is my exact one:
Quote:
#!/sbin/runscript

start() {
ebegin "Starting hlds_1..."
cd /home/ps2cho/hlds_1/
./hlds_run -game czero +port 27015 +maxplayers 13 -pingbooster 3"
eend $?
}

stop() {
ebegin "Stopping hlds_1..."
killall hlds_run
eend $?
}

Last edited by ps2cho; 07-28-2005 at 02:04 PM.
 
Old 07-28-2005, 02:02 PM   #13
ps2cho
Member
 
Registered: Jun 2005
Posts: 36

Original Poster
Rep: Reputation: 15
Sorry noticed i accidently had a " at the end of the line.
ok i fixed it here is the error i get:

Quote:
server ~ # /etc/init.d/hlds_1 start
* Re-caching dependency info (mtimes differ)...
* Starting hlds_1... ...
/etc/init.d/hlds_1: line 5: /home/ps2cho/hlds_1/: is a directory
/etc/init.d/hlds_1: line 6: ./hlds_run: No such file or directory [ !! ]
 
Old 07-28-2005, 02:03 PM   #14
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
The extra quote after the 3 might be that problem.
 
Old 07-28-2005, 02:05 PM   #15
ps2cho
Member
 
Registered: Jun 2005
Posts: 36

Original Poster
Rep: Reputation: 15
too late
 
  


Reply



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
vsftpd deamon MMMarc Linux - Newbie 2 02-06-2005 09:19 AM
Lisa Deamon ptreves Linux - Networking 6 09-09-2004 02:47 PM
Cron deamon? eXor Slackware 4 07-02-2003 11:55 AM
the acme deamon saturn_vk Linux - Software 0 03-25-2003 02:55 PM
cron Deamon DJFauß Linux - General 2 01-22-2002 03:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 05:41 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
Open Source Consulting | Domain Registration