Forum: CFEngine Help
Subject: Re: Normal ordering, files and commands
Author: phnakarin
Link to topic: https://cfengine.com/forum/read.php?3,27135,27153#msg-27153

The fun fact is CFEngine marks those promises as kept/not kept and does not try 
to do it for this run if it remains in the same class. (It will correct up the 
permission in the next run anyway.) If you'd like to make it done in a run, 
then you should play around with classes: context bit as classes: is evaluated 
every pass. For instance;


   classes:

      "have_null"   expression => fileexists ("${cbind_dir}/dev/null");
      "cdev_null"          not => fileexists ("${cbind_dir}/dev/null");       # 
Test if null device exist
      "have_random" expression => fileexists ("${cbind_dir}/dev/random");
      "cdev_random"        not => fileexists ("${cbind_dir}/dev/random");     # 
Test if random device exist

   files:

    have_null::
      "${cbind_dir}/dev/null"
         comment => "Fix null device permission",
         perms => mog("666", "root", "root"),
         create => "false";

    have_random::
      "${cbind_dir}/dev/random"
         comment => "Fix random device permission",
         perms => mog("666", "root", "root"),
         create => "false";


Cheers,
-- Nakarin

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to