[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with shellcommand and background job
From: |
Christian Pearce |
Subject: |
Re: Problem with shellcommand and background job |
Date: |
Thu, 17 Feb 2005 16:24:10 -0500 |
Here is the exact code from our SysNav 5.0 release. This is what I use
to restart the clients and the server if need be. Notice I renamed my
runbb.sh to runbb-server.sh for our proxynodes.
processes:
_proxynode.bb_installed::
"runbb-server.sh"
restart "$(bb_prefix)/bb/runbb-server.sh start"
owner=$(sysnav_user)
bb_installed::
"bb-local"
restart "$(bb_prefix)/bbc/runbb.sh start"
owner=$(sysnav_user)
Here is an example of something that held onto the STDOUT, and STDERR.
# Reboot if scheduled automation occurs
reboot::
'$(shutdown) -y -g 300 -i 6 "SysNav is rebooting the server to
install patch Clusters." > /dev/null 2>&1 &'
useshell=true
Notice I pipe both STDOUT and STDERR to /dev/null and then background
it. This works like a champ.
There is also this like in the wiki.
http://cfwiki.org/cfwiki/index.php/Hung_Shell_Command
On Thu, 2005-02-17 at 15:30, David Douthitt wrote:
> Manon Goo wrote:
> > I have tried to restart BigBrother from cfengine (2.1.13 ) the
> > BigBrother restart script starts some other processes in background
> > but these to not close the STDIN and STDERR. Now cfengine habs
> > infinite unless I redirect the output of The restart script.
>
> I don't know if there is a way around it, but I believe that is expected
> behavior, though incorrect behavior. The programs should close STDIN
> and STDERR, but if they do not then things hang.
>
> I ran into this trying to get some programs to run during system startup
> in initialization scripts.
>
> The real question is: can cfengine work around this? I believe you can
> use a shell script to "hold" the process which doesn't close STDIN and
> STDERR properly.
--
Christian Pearce
http://www.commnav.com
http://www.perfectorder.com