Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> need hint on running multiple instance of same programe
jeanseb1987
post Apr 12 2009, 08:07 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 12-April 09
Member No.: 14,396



Hi

im new to linux, im running on a virtual private server http ftp and a game server called sa-mp

to start the sa-mp server i find an .sh script that i've put in the init.d folder.
so far so good.
here is the script im using:

#!/bin/sh

sampdir="/home/vent/samp"
process=`ps auxw | grep samp02Xsvr | grep -v grep | awk '{print $11}'`

if [ -z "$process" ]; then

echo "sa-mp server not running, restarting it."
cd "$sampdir"
nohup ./samp02Xsvr &
echo ""

fi

My question is: what do i need to do to be aible to run 2 instance of the same processe and have them auto-restart like it does for 1 server???

thank you for your time !!!
Go to the top of the page
 
+Quote Post
michaelk
post Apr 12 2009, 10:23 AM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,797
Joined: 23-January 03
Member No.: 360



Not a game player so I know nothing about sa-mp. I am also not sure what your goals are but you can not run a second instance of the game using the same UDP
port. I am not sure if you can specify a configuration file that is not in the top directory of the server. I suppose you would need to create a 2nd copy of the server with its own config file and then create another init script.
Go to the top of the page
 
+Quote Post
jeanseb1987
post Apr 12 2009, 10:44 AM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 12-April 09
Member No.: 14,396



Thank you

i find my solution.

i simply rename each process to a different name.
each process have an .sh script that is in crontab

thank you anyway for your help
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st October 2017 - 06:19 PM