File and folder rights

thierry thunot <[email protected]>
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
Good morning all, 
I am going to show you a basic recurring problem with the rights on files 
or directories. I want the file or directory rights to be good on creation. 

Despite many attempts I cannot get a folder or file created to be 
immediately affiliated with the right user with the right rights. 
You have to wait for a new cfengine pass to get the right rights. Ditto for 
recursion when there are several files or directories. Here is an example :

bundle agent client_reporting
{
        vars:

          "fic_report"       string      => 
"/home/reporting/reporting_$(sys.host).txt";
          "ressource_disk"   string      => execresult("/usr/bin/echo 
\"disques                       Util% Point de Montage\"; df -H | grep 
disk","useshell");
          "redhat_version"   string      => execresult("/usr/bin/cat 
/etc/redhat-release","useshell");
        # "ip"               slist       => { @(sys.ip_addresses) };
          "interface_reseau" slist       => { @(sys.interfaces) };

        files:
        "/home/reporting/."
        perms => mog( "700", "cfsshd", "root"),
        create => "true",
        depth_search => include_base,
        comment => "creation du repertoire de reporting";


#       "/home/reporting"
#       perms => mog( "700", "cfsshd", "root"),
#       comment => "droit du repertoire pour user cfsshd";

        "/home/reporting/"
        delete => tidy,
        file_select => plain,
        depth_search => include_base,
        action => if_elapsed("120"),
        comment => "effacement du fichier de report avant recreation";

        classes:
          "is_fic_report" expression => fileexists("$(fic_report)");

        reports:
        !is_fic_report::
        "Reporting du client $(sys.host) du $(sys.date)
        
        #################################################
                        OS

        FQDN................................$(sys.fqhost)
        Noyau...............................$(sys.version)
        Type arch(detail)...................$(sys.long_arch)
        Type arch...........................$(sys.arch)
        Version OS..........................$(redhat_version)
        Version Cfengine....................$(sys.cf_version)   
        #################################################
                        DISK
        $(ressource_disk)
        
        #################################################
                        RESEAU
 "
        report_to_file => "$(fic_report)";

        "
        Interface Réseau activ.............$(interface_reseau)
        Adresse IP de la machine............$(sys.ipv4[$(interface_reseau)])
        Adresse MAC 
:.......................$(sys.hardware_mac[$(interface_reseau)])

        "
        report_to_file => "$(fic_report)";

        files:
        "/home/reporting/."
        depth_search => recurse( inf ),
        perms => mog( "700", "cfsshd","root"),
        comment => "creation du repertoire de reporting";
        }
note that after 2 pass it's ok
Could you explain me how use right ???
Thank's a lot

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/f6775767-2693-4019-b7d4-988d754096b8n%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.