Is it possible to use $ROOTCMD in cfengine scripts?

I update a configuration file for tex-common, and want to run update-texmf after that. It must work both for install and softupdate.

This is what I tried with in my script:

  shellcommands:
    any::
      ${ROOTCMD} /usr/sbin/update-texmf

The error from cfengine says that the command must be an absolute path, and since I tried this on a softudate where $ROOTCMD should be a null string, $ROOTCMD might not be exported to the script. Or would an empty string cause this problem?

I resorted to using a separate shell-script, but it would be nice to have everything in the same script.

I would probably be able to create a class script which defines FAI_ACTION as a class, and then check for that class in the cfengine script:

  shellcommands:
    install::
      /sbin/chroot /tmp/target /usr/sbin/update-texmf
    softupdate::
      /usr/sbin/update-texmf

Does anyone have a better idea?

/Per

Antwort per Email an