LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (http://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   gentoo deamon (http://www.linuxquestions.org/questions/linux-distributions-5/gentoo-deamon-346824/)

ps2cho 07-26-2005 02:59 AM

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?

Matir 07-27-2005 12:19 PM

I think you need a line like:
Code:

opts="start stop"
Also, what happens if you run the init script from the console?

ps2cho 07-27-2005 12:47 PM

It says file cannot be found

Matir 07-27-2005 01:16 PM

Did you run it like running any other init script?

cs-cam 07-27-2005 09:15 PM

Did you make the file execuatble? chmod +x filename

ps2cho 07-28-2005 03:17 AM

yes to both.

Matir 07-28-2005 10:00 AM

Ok, when running it, what output do you get?

ps2cho 07-28-2005 01:26 PM

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

Matir 07-28-2005 01:31 PM

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 ...


ps2cho 07-28-2005 01:54 PM

Tried that, it says that the cd /home etc... line is invalid.

Matir 07-28-2005 02:08 PM

It says the line is "invalid"?

ps2cho 07-28-2005 03:00 PM

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 $?
}

ps2cho 07-28-2005 03:02 PM

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 [ !! ]

Matir 07-28-2005 03:03 PM

The extra quote after the 3 might be that problem. :)

ps2cho 07-28-2005 03:05 PM

too late :)


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