help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: user adding and "files"


From: Wheeler, John
Subject: RE: user adding and "files"
Date: Fri, 15 Oct 2004 10:12:10 -0500

In the spirit of convolving to the desired state, you could bracket the
actions that require the user to not be enabled unless the user exists.

classes:
    blahuser = ( Returnszero( /bin/getent passwd blahuser) )



my syntax and function name may not be correct above. Then

copy:
   blahuser::
        /blah/blah
           dest=/blah/blah/blah
           user=blahuser
           server=myserver

This requires at least two runs of cfagent to get you where you need to
be.

> -----Original Message-----
> From: help-cfengine-bounces+jwheeler=eb.com@gnu.org
[mailto:help-cfengine-
> bounces+jwheeler=eb.com@gnu.org] On Behalf Of John Borwick
> Sent: Thursday, October 14, 2004 1:33 PM
> To: help-cfengine@gnu.org
> Subject: user adding and "files"
> 
> When I add a user and use that username somewhere later in the script,
> cfengine doesn't know about the user.  If I run the script a second
> time, of course, the user is known.
> 
> For the following script:
> 
> __BEGIN__
> control:
>          actionsequence = ( shellcommands files )
> 
> shellcommands:
>          "/usr/sbin/useradd test"
> 
> files:
>          /tmp/test
>          owner=test
>          r=inf
>          act=fixall
> __END__
> 
> 
> The user "test" is not known to the "files" section.  See the message
> "setting to -1":
> 
> *********************************************************************
>   Main Tree Sched: shellcommands pass 1 @ Thu Oct 14 14:29:58 2004
> *********************************************************************
> 
> cfengine:: Executing script /usr/sbin/useradd
> test...(timeout=0,uid=-1,gid=-1)
> (Setting umask to 77)
> cfengine:: Finished script /usr/sbin/useradd test
> 
> *********************************************************************
>   Main Tree Sched: files pass 1 @ Thu Oct 14 14:29:58 2004
> *********************************************************************
> 
> Checking file(s) in /tmp/test
> cfengine::   touching /tmp/test
> cfengine:: Owner of /tmp/test was 0, setting to -1
> cfengine::   touching /tmp/test/t
> cfengine:: Owner of /tmp/test/t was 0, setting to -1
> Saving the setuid log in
/var/cfengine/cfagent.f4n35.wfunet.wfu.edu.log
> ---------------------------------------------------------------------
> 
> __END__
> 
> 
> Why is this?  Are there any workarounds?
> 
> Yours,
> John
> --
>             John Borwick
>         System Administrator
>        Wake Forest University | web  http://www.wfu.edu/~borwicjh
>        Winston-Salem, NC, USA | GPG key ID             0x797326D5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]