LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Creating a new bootup script (https://www.linuxquestions.org/questions/linux-newbie-8/creating-a-new-bootup-script-790007/)

pmflav 02-18-2010 01:58 PM

Creating a new bootup script
 
Hi all.

Running Centos5 with the latest webmin, WHM and Cpanel.

I am trying to run the following as a startup script through webmin, but so far no joy. Searched the internet for a couple of hours last night and couldn't find the answer.

I am wanting the following to start on bootup.
Quote:

cd /home/aussied/.gameservers/bf2_0/mono bf2ccd.exe -autostart
Tried using the below, but to no joy.

Quote:

#!/bin/sh
# description: BF2 startup scrip, including bf2cc
# chkconfig: 2345 99 00

case "$1" in
'start')
cd /home/aussied/.gameservers/bf2_0
screen -A -m -d ./mono bf2ccd.exe -autostart

;;
'stop')
rm -f /var/lock/subsys/BF2
;;
*)
echo "Usage: $0 { start | stop }"
;;
esac
exit 0
If anyone could help me with this I would be grateful.

Thankyou

kbp 02-18-2010 04:31 PM

I'm not sure that the '00' in "# chkconfig: 2345 99 00" is valid... try '01'

If you run the commands -

Code:

cd /home/aussied/.gameservers/bf2_0
screen -A -m -d ./mono bf2ccd.exe -autostart

.. manually, does it work ?

Can you post the output of :

Code:

chkconfig --list (bf2 or whatever you called the script)
cheers

chrism01 02-18-2010 04:34 PM

Quote:

bf2ccd.exe
That should mean its an MS program which will not work natively in Linux; you'd need Wine http://www.winehq.org/.
*nix executables do not have that extension (binaries don't have any extension).

kbp 02-18-2010 04:58 PM

The developers may have written the .exe to be mono compatible, so it should be ok Chris

chrism01 02-18-2010 05:03 PM

Might be worth running the 'file' cmd on it to see.

pmflav 02-18-2010 10:40 PM

Thankyou for the replies so far.
Yes this is run under mono, and it runs fine in the command.

Runs under terminal as above and also with the screen command.

I just can't get it to run on system bootup.

The most frustrating part of this is that I did get something similar to this running a couple of years ago, the way I want it. Just can't for the life of me remember how I did it.

kbp 02-19-2010 04:28 PM

chkconfig output ?

theNbomr 02-19-2010 07:04 PM

Don't forget, if it is a graphical application, it will not start until after X has started.
--- rod.


All times are GMT -5. The time now is 01:44 AM.