bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A buglet in shellcommands


From: Mark . Burgess
Subject: Re: A buglet in shellcommands
Date: Sat, 9 Oct 2004 16:43:30 +0200 (MEST)

Thanks - patch in 2.1.11

On 20 Sep, "Sami J. Mäkinen" wrote:
> 
> I used something like this in cfagent.conf:
> 
> --- 8< ---
> shellcommands:
>    any::
>      "/bin/sh -c 'echo $(host_profile) > /etc/NWS/host_profile'"
>      "/bin/sh -c 'echo $(host_profile) > /etc/NWS.host_profile'"
>      "/bin/sh -c 'echo $(net_profile) > /etc/NWS/net_profile'"
>      "/etc/NWS/cf-customize-me-harder-baby.sh" timeout=5
> --- 8< ---
> 
> Note the two almost-similar lines "NWS/host_profile"
> and "NWS.host_profile". We are changing the naming
> convention of certain files and in the process, both
> old and new names are available. That's why there are
> two almost but not quite identically named files present.
> 
> This produces the following output from cfagent -v:
> 
> --- 8< ---
> GNU Configuration Engine -
> 2.1.10
> ...
> *********************************************************************
>   Main Tree Sched: shellcommands pass 1 @ Mon Sep 20 16:56:56 2004
> *********************************************************************
> 
> cfengine:naula: Executing script /bin/sh -c 'echo KLO > 
> /etc/NWS/host_profile'..
> .(timeout=5,uid=-1,gid=-1)
> (Setting umask to 77)
> cfengine:naula: Finished script /bin/sh -c 'echo KLO > 
> /etc/NWS/host_profile'
> cfengine:naula: Nothing scheduled for 
> shellcommand._bin_sh__c__echo_KLO____etc_N
> WS_host_profile_ (0/1 minutes elapsed)
> --- 8< ---
> 
> ...and the latter of the almost identical shellcommands
> never gets executed.
> 
> This is not a big deal but it _might_ be a good idea to use
> something like a md5 for the lock names.
> 
> I do not know cfengine internals very well, but my
> wild guess is that cfagent internally generates a "lock"
> for every "todo" and two very identical-looking
> lines may result in a name conflict in the lock.
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  address@hidden
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

[Prev in Thread] Current Thread [Next in Thread]