--- On Sun, 2/1/09, Shachar Shemesh <shac...@shemesh.biz> wrote:
> From: Shachar Shemesh <shac...@shemesh.biz>
> Subject: Re: ptrace in production systems
> To: valery_rez...@yahoo.com
> Cc: "linux-il" <linux-il@cs.huji.ac.il>
> Date: Sunday, February 1, 2009, 4:18 PM
> Valery Reznic wrote:
> >
> >
> > What about following:
> > #!/bin/sh
> >
> > while :; do
> > snmp_agen
> > done
> >
> >
> A daemon returns immediately. Even had that been what I
> wanted (it's not - sometimes we really want to shut down
> the agent) what you wrote is a busy loop that keeps trying
> to launch the agent.
I knew I miss something :(
Usually daemons have switch something like 'keep in foreground'
So script can be changed to
while :; do
snmp_agen --keep-in-foreground
done
And whole script should be run in the background.
If you want some way to shut down the agent you can kill script and then agent.
Or catch say SIGTERM in the script and kill agent from the script itself.
Valery.
>
> Shachar
_______________________________________________
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il