[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ReturnsZero(): command does not return zero. Is classcreatedwith val
From: |
Mark . Burgess |
Subject: |
Re: ReturnsZero(): command does not return zero. Is classcreatedwith value of false? |
Date: |
Thu, 29 Apr 2004 18:46:12 +0200 (MEST) |
The following works fine for me:
control:
actionsequence = ( editfiles )
classes:
xxx = ( ReturnsZero(/bin/true) )
yyy = ( ReturnsZero(/bin/false) )
alerts:
xxx::
"true worked!!"
yyy::
"false didn't work!!"
i.e. it prints one message "true worked".
Can someone provide more info about what has changed
in cfengine here? I cannot see any differences and the
code of 2.0.7 and 2.1.5 look the same at first glance.
M
On 28 Apr, Villalovos, John L wrote:
>> Has anything happened on this issue?
>>
>> I just upgraded from 2.0.7p3 to 2.1.5 and now my ReturnsZero
>> statements don't seem to work anymore :(
>>
>>
>> groups:
>>
>> # The web server is called httpd in Red Hat 8.0 forward
>> hasWebServer_rh8 = ( ReturnsZero(/bin/rpm -q --quiet httpd) )
>> # The web server is called apache in Red Hat 7.x
>> hasWebServer_rh7 = ( ReturnsZero(/bin/rpm -q --quiet apache) )
>> # See if phpMyAdmin is installed
>> has_phpMyAdmin = ( ReturnsZero(/bin/rpm -q --quiet
>> phpMyAdmin) )
>>
>> shellcommands:
>>
>> webServer.redhat_7.!hasWebServer_rh7::
>> "/usr/sbin/up2date apache"
>> "/sbin/chkconfig httpd on"
>> "/sbin/service httpd start"
>>
>> webServer.redhat_8.!hasWebServer_rh8::
>> "/usr/sbin/up2date httpd"
>> "/sbin/chkconfig httpd on"
>> "/sbin/service httpd start"
>>
>> # Install phpMyAdmin if a phpMyAdmin server
>> phpMyAdminServer.!has_phpMyAdmin::
>> "/usr/sbin/up2date phpMyAdmin"
>>
>>
>> After upgrading to 2.1.5, none of my ReturnsZero commands are working.
>> The classes are not being created.
>
> I played around with this some more and ran cfagent -d0 -v and found the
> following:
>
> RVAL-FUNCTION ReturnsZero(/bin/rpm -q --quiet httpd)
> HandleFunctionObject(ReturnsZero(/bin/rpm -q --quiet httpd))
> IsBuiltinFunction(ReturnsZero(/bin/rpm -q --quiet httpd))
> IsBuiltinFunction: ReturnsZero(/bin/rpm -q --quiet httpd)
> ExpandVarstring(/bin/rpm -q --quiet httpd)
> HandleFunction: ReturnsZero(/bin/rpm -q --quiet httpd)
> HandleReturnsZero(/bin/rpm -q --quiet httpd)
> cfengine:: Wait for child failed
> ExpandVarstring(XX_CF_opposite_any_XX)
> HandleGroupRVal(XX_CF_opposite_any_XX) group (hasWebServer_rh8), type=0
> [No match of class XX_CF_opposite_any_XX]
>
> So does anyone know why cfengine would have "Wait for child failed"?
> This did NOT happen in 2.0.7. Did the exec code get changed?
>
> Thanks,
> John
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272 Email: Mark.Burgess@iu.hio.no
Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~