Where exactly does the sleep command go
-----Original Message-----
From: Eben King [mailto:eben1@tampabay.rr.com]
Sent: Wednesday, October 01, 2003 1:11 PM
To: slug@nks.net
Subject: Re: [SLUG]
On Wed, 1 Oct 2003, Eben King wrote:
> On Wed, 1 Oct 2003, Ian Blenke wrote:
>
> > Robert E. Schaefer wrote:
> > > What I looking for is a way to autostart 6 different instances of
> > > this at runlevel 3 and way of checking to make sure that all the
> > > servers are running and restart any that have crashed.
> >
> > When running game servers, I've found it best to use a script
> > wrapper with an infinite loop (also, run it as a user like
> > "halflife", NOT AS ROOT, it's just a smart thing to do):
> >
> > #!/bin/bash
> > # Create this as "restartscript.sh" in your path
> > while /bin/true; do
Oh yeah; you can make that "while : ; do", which, being evaluated by the
shell, reduces the number of fork/execs.
> > echo $$ > /var/run/restartscript.pid
> > su - halflife -c ./hlds_run
And you might want to make this "echo blah > blah && sudo blah blah"; in
case the echo fails (filesystem full, permission denied, whatever), the
sudo doesn't get run. You probably should use sudo instead of su, as su
won't be passwordless for non-root.
> Don't forget to put a "sleep" in here; else; if something's wrong with
> hlds_run, this script will go into a fast loop.
>
> > done
-- -eben ebQenW1@EtaRmpTabYayU.rIr.OcoPm home.tampabay.rr.com/hactarLogic is a systematic method of coming to the wrong conclusion with confidence.
----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.
----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.
This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:44:51 EDT