LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-18-2010, 01:58 PM   #1
pmflav
LQ Newbie
 
Registered: Feb 2010
Posts: 2

Rep: Reputation: 0
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
 
Old 02-18-2010, 04:31 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
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
 
Old 02-18-2010, 04:34 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,362

Rep: Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377
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).
 
Old 02-18-2010, 04:58 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
The developers may have written the .exe to be mono compatible, so it should be ok Chris
 
Old 02-18-2010, 05:03 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,362

Rep: Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377
Might be worth running the 'file' cmd on it to see.
 
Old 02-18-2010, 10:40 PM   #6
pmflav
LQ Newbie
 
Registered: Feb 2010
Posts: 2

Original Poster
Rep: Reputation: 0
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.
 
Old 02-19-2010, 04:28 PM   #7
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
chkconfig output ?
 
Old 02-19-2010, 07:04 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

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


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
run a shell script after linux bootup shibu_sp Linux - Newbie 2 01-28-2010 11:53 AM
Mounting USB from Script at bootup fails silent echo Linux - General 7 12-10-2007 03:12 AM
how to put my script in bootup packets Solaris / OpenSolaris 3 10-31-2007 12:27 PM
bootup script? andymadigan Debian 2 08-04-2004 05:32 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 10:23 PM


All times are GMT -5. The time now is 10:05 AM.

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