Originally posted by murder
here is the command i am using only in a script i have 2 instances of this command running is there a way to kill them individually
./cod_lnxded +set net_ip 188.8.131.52 +set net_port 28960 + set ttycon 0 +set dedicated 2 +exec server.cfg +set fs_homepath /home/murder/cod/codsd +set fs_basepath /home/murder/cod/codsdinstall &
I would go along the line of what puffinman said, I don't actually think you can reserver PIDs as they are generatedautomatically.
If your running Debian, you could use the start-stop-daemon command just like the init scripts, this would actually create the pid reference files for you.
# start-stop-daemon --start --pidfile /var/run/myapp1.pid --make-pidfile --background --exec /usr/local/bin/myapp1 option1 option2
# start-stop-daemon --stop --pidfile /var/run/myapp1.pid
# start-stop-daemon --start --pidfile /var/run/myapp2.pid --make-pidfile --background --exec /usr/local/bin/myapp1 option1 option2
# start-stop-daemon --stop --pidfile /var/run/myapp2.pid
replacing myapp1,2 and optionX with your paths and arguments etc...
or you could expand your current script to create them after the server is called, maybe by using the $$ or $! environment variables (if bash)