[Top][All Lists]

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

A buglet in shellcommands

From: Sami J. Mäkinen
Subject: A buglet in shellcommands
Date: Mon, 20 Sep 2004 17:10:42 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803

I used something like this in cfagent.conf:

--- 8< ---
    "/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 -
 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'..
(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.

-- sjm
"Pirättäkää. Nakkeletta nuallen rassukoollen peräkoijasta
 jokuja napollisia opaalia."  - Junttapurin maharatsa

reply via email to

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