commands promise and exec_timeout

56 views
Skip to first unread message

robu...@gmail.com

unread,
Jul 22, 2014, 7:46:33 AM7/22/14
to help-c...@googlegroups.com
Hi all,

I have a strange issue with a commands promise.

I like to execute

commands:
"/usr/bin/swatch"
               args        =>  "--script-dir=/root --config-file=/etc/swatch/swatch-auth.conf --tail-file=/var/log/auth.log --tail-args=--follow=name --daemon";

calling this from the command-line,
the command returns immediately with exit status "0"

cf-agent on the other side hangs here whatever I trie.
I tried
- putting all "args" into the promiser string,
- running with no extra options,
- running with a contain body with:
--- useshell or noshell (noshell should be okay though, right?)
--- exec_timeout 
--- different umask values

it's all the same:
the command IS executed (it's running after cf-agent evaluated the promise)
but immediately after this command cf-agent is waiting infinitely ,
keeps waiting passing any timeout (the timeout is mentioned by cf-agent -v as the last output)

I have several other commands promises which are all working fine.

Anybody any idea, or how to debug this further

TIA

Robur



Neil Watson

unread,
Jul 22, 2014, 8:37:17 AM7/22/14
to help-c...@googlegroups.com
I'm not familiar with the swatch command, but I suspect it's a command
that holds open file handles like stdout, forcing cf-agent to wait for
closure that never comes.

You'll need to wrap this command in something.

--
Neil H Watson
Compliance reporting with CFEngine Community http://evolvethinking.com/products/delta-reporting/
Simplify CFEngine with EFL http://evolvethinking.com/evolve-thinkings-free-cfengine-library/
VIM and Cfengine https://github.com/neilhwatson/vim_cf3
CFEngine support and training from Evolve Thinking, http://evolvethinking.com

Nick Anderson

unread,
Jul 22, 2014, 9:45:56 AM7/22/14
to help-c...@googlegroups.com
On 07/22/2014 07:37 AM, Neil Watson wrote:
> I'm not familiar with the swatch command, but I suspect it's a
> command that holds open file handles like stdout, forcing cf-agent to
> wait for closure that never comes.
>
> You'll need to wrap this command in something.

You might want to try the daemonize bundle that Brian submitted recently.


https://github.com/cfengine/masterfiles/blob/63bf31847db145478d8f52a75a04a19b88217322/lib/3.6/commands.cf#L50-65

robu...@gmail.com

unread,
Jul 22, 2014, 10:06:12 AM7/22/14
to help-c...@googlegroups.com
Thnx Neil, Nick ...


You might want to try the daemonize bundle that Brian submitted recently.

https://github.com/cfengine/masterfiles/blob/63bf31847db145478d8f52a75a04a19b88217322/lib/3.6/commands.cf#L50-65

Brilliant, that did the trick!
Now it works like a charm.

Thnx a lot!

Robur

Brian Bennett

unread,
Jul 22, 2014, 8:49:26 PM7/22/14
to robu...@gmail.com, help-c...@googlegroups.com
Glad to hear, even though I didn't see this until after I had helped you ;-)

-- 
Brian Bennett
Looking for CFEngine training?
http://www.verticalsysadmin.com/

--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengin...@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages