[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SOLVED: Re: cfengine-die help...
From: |
Christian Pearce |
Subject: |
SOLVED: Re: cfengine-die help... |
Date: |
Wed, 15 Sep 2004 11:05:36 -0400 |
reboot::
'$(shutdown) -y -g 300 -i 6 "SysNav is rebooting the server to
install patch Clusters." > /dev/null 2>&1 &'
useshell=true
This worked. It detaches from the pipe by redirecting to /dev/null.
On Wed, 2004-09-15 at 08:39, Christian Pearce wrote:
> On Wed, 2004-09-15 at 02:58, Predrag Zecevic - Solaris System
> Administrator wrote:
> > Have you tried w/o echo command?
>
> Yes it hangs. Even with background set to true.
>
> > Did you tried to debug it?
>
> Yes. There isn't much debugging statements for that part of the code.
> The cfengine-die causes a SIGALRM which causes the process to
> terminate. a nohup only blocks SIGHUP. We would have to rewrite the
> code.
>
> >
> > Regards ;-)
> >
> > Christian Pearce wrote:
> >
> > >I mistakenly put that before. I want the shutdown to go into the
> > >background. If I did && it would wait for shutdown to finish then it
> > >would echo "cfengine-die". Which leaves me where I was before. I think
> > >the shell command is correct. I am puzzled as to why shutdown gets
> > >killed. hmm maybe nohup doesn't block the SIGALRM. Only the SIGHUP.
> > >Maybe we need to change this behavior in cfengine. Considering we
> > >aren't using the alarm timer for anything other than 0. Which is
> > >immediate. This way we could block the hup with a nohup. Unless I am
> > >misunderstanding this.
> > >
> > >On Tue, 2004-09-14 at 11:03, Predrag Zecevic - Solaris System
> > >Administrator wrote:
> > >
> > >
> > >>Hi Christian,
> > >>
> > >>you are missing one '&' in command bellow: shouldn't this look like: ...
> > >>&& echo "cfengine-die" ?
> > >>Regards ;-)
> > >>
> > >>Christian Pearce wrote:
> > >>
> > >>
> > >>
> > >>> # Reboot if scheduled automation occurs
> > >>> reboot::
> > >>> '$(nohup) $(shutdown) -y -g 300 -i 6 "SysNav is rebooting the
> > >>>server to install patch Cluster(s)." & echo "cfengine-die"'
> > >>> background=true
> > >>> useshell=true
> > >>>
> > >>>Can someone explain to me the process under which cfengine kills a
> > >>>forked script? This is the last statement I tried. I call shutdown
> > >>>with nohup, but that doesn't seem to keep cfengine from killing it after
> > >>>I echo the cfengine die. Unfortunately if I don't use cfengine-die
> > >>>cfengine will not continue executing.
> > >>>
> > >>>I assume this is the code that does it
> > >>>
> > >>> if (ptr->timeout != 0)
> > >>> {
> > >>> alarm(0);
> > >>> signal(SIGALRM,SIG_DFL);
> > >>> }
> > >>>
> > >>>alarm(0) sets the seconds for the signal to be generated to zero.
> > >>>signal(SIGALRM, SIG_DFL) executes Terminate by default with the SIG_DFL
> > >>>handle.
> > >>>
> > >>>But shutdown still gets killed off.
> > >>>
> > >>>
> > >>>
> > >>>
--
Christian Pearce
http://www.commnav.com
http://www.perfectorder.com