Robinson Tiemuqinke wrote: > Hi, > > Thanks for example. But which version of cfengine are > you running? > > I'm using cfengine 2.1.18 and the ReturnsZero > function always thinks that the included commands > returns zero (success)!! -- pretty Odd and Funny! > > See my example: > ... > netBoot = ( ReturnsZero(/bin/sh -c > "PATH=/bin:/usr/bin:/sbin:/usr/sbin ; > mount | egrep '^/dev/ram.*?[ \t]+on[ \t]*/[ \t]*' >> /dev/null 2>&1") ) > localBoot = ( ReturnsZero(/bin/sh -c > "PATH=/bin:/usr/bin:/sbin:/usr/sbin ; > mount | egrep '^/dev/[sh]da.*?[ \t]+on[ \t]*/[ > \t]*' > /dev/null 2>&1") ) > ... > > Only one shoud be true, either from ramdisk > (/dev/ram?) or local disk (/dev/[sh]da) my machines > will find its root file system. But see what? cfengine > sets both netBoot and localBoot classes at the same > time on any machines! > > from command line we can see that one command returns > exit code 0, anther one returns 1 if we run the above > encolsed commands manually. > > Please help. >
You are using a shell wrapper -- the shell can exit cleanly evn though the child process doesn't... _______________________________________________ Help-cfengine mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-cfengine
