[cod] Can cod write to a pid file?

hotrod deathtoll hotrod_death_toll at yahoo.com
Mon Dec 6 21:42:10 EST 2004


If your looking to write a pid file for stop and start
I usually make a case statment.  The trick is knowing
which shell built-in variable to use.

$? is the exit code of the last ran process
$$ is the current running process id
$! is the last running process id

You kinda need something that you can run in the
background to see this for your self.  If you have
"xterm" installed you can see this for your self by
running "xterm &" after you do this run "echo $!" and
it will print out your last running process id.  Now
if you run "ps -ef | grep pid" you'll see your xterm
running still.  You can run "kill pid" to stop that
xterm or type "fg" to put the xterm in the foreground.
 Once this is done you can type "exit" to close the
xterm.  This is a general example that you can test
just to show you, it's harmless to try.

I'll add a skeleton script I like to use and put
comments in but please try what I showed you above so
you know what happens if it breaks.

The script will need to be cut and pasted out of
windows because it will have the wrong return key
control characters for linux/unix.  You can use
dos2unix but it you're not familiar with it just cut
and paste. 

John

I hope this helps those that don't know how to do
this.

--- Steven Hartland <killing at multiplay.co.uk> wrote:

> just use a wrappering script or something like
> screen
>   ----- Original Message ----- 
>   From: Todd Chamberlain 
>   To: cod at icculus.org 
>   Sent: Monday, December 06, 2004 8:57 PM
>   Subject: [cod] Can cod write to a pid file?
> 
> 
>   I'm fairly new to this lise, and have found it
> very useful.  Thank you to whoever put it together,
> and thank you to Ryan for the linux binaries!
> 
>   I'm also fairly new to linux server
> administration, so I'm hoping this is an easy one: 
> Is there an easy way to get CoD and CoD:UO to write
> to a pid file (for the purpose of
> stopping/restarting via web app)?
> 
>   Thanks,
>   Todd Chamberlain
> 
> 
> ================================================
> This e.mail is private and confidential between
> Multiplay (UK) Ltd. and the person or entity to whom
> it is addressed. In the event of misdirection, the
> recipient is prohibited from using, copying,
> printing or otherwise disseminating it or any
> information contained in it. 
> 
> In the event of misdirection, illegible or
> incomplete transmission please telephone (023) 8024
> 3137
> or return the E.mail to postmaster at multiplay.co.uk.


		
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: script.sh.txt
URL: <http://icculus.org/pipermail/cod/attachments/20041206/709bb663/attachment.txt>


More information about the Cod mailing list