Re: Retrieving certain files from a directory

2010-03-17 Thread Neil Watson
Can you show us what you've tried? -- Neil Watson Linux/UNIX Consultant http://watson-wilson.ca ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine

RE: Deleting local accounts

2010-03-17 Thread Justin Lloyd
Ok, it does seem best, then to roll my own solution. Thanks for the feedback, all. Justin -Original Message- From: Mark Burgess [mailto:mark.burg...@iu.hio.no] Sent: Wednesday, March 17, 2010 11:27 AM To: nwat...@symcor.com Cc: Justin Lloyd; help-cfengine@cfengine.org; help-cfengine-bou

Retrieving certain files from a directory

2010-03-17 Thread Justin Lloyd
Ok, I'm stumped again. I've been working on a problem for hours. I want to effectively do the following on each client: client# scp policy_host:/usr/local/etc/*.rc /usr/local/etc but I can't figure out how to set up the access rules and files promise. I keep getting either access errors or a copy

Re: /var/cfengine not created during install

2010-03-17 Thread Scott Behrens
That worked, thanks a bunch! Scott On Wed, Mar 17, 2010 at 3:37 PM, Neil Watson wrote: > I think if you run cf-key it will create /var/cfengine but usually I > create it by hand. > > -- > Neil Watson > Linux/UNIX Consultant > http://watson-wilson.ca > ___

Re: /var/cfengine not created during install

2010-03-17 Thread Neil Watson
I think if you run cf-key it will create /var/cfengine but usually I create it by hand. -- Neil Watson Linux/UNIX Consultant http://watson-wilson.ca ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfe

Re: Array in classes expressions

2010-03-17 Thread Mark Burgess
This might have been fixed today in svn. Lebel, Marco wrote: > Hello all, > > > > Is there a reason why we can use vars in classes definition > > > > Like: > > > > "$(user_names)_must_modified" expression => > "!$(user_names)_comment_equal|!$(user_names)_homedir_equal|!$(user_names)_s

Array in classes expressions

2010-03-17 Thread Lebel, Marco
Hello all, Is there a reason why we can use vars in classes definition Like: "$(user_names)_must_modified" expression => "!$(user_names)_comment_equal|!$(user_names)_homedir_equal|!$(user_names)_shell_equal|!$(user_names)_Gid_equal"; But cannot do the same thing with array variables Like: "

Re: configure.ac error in SVN

2010-03-17 Thread Mark Burgess
Thanks, appreciate it. Jesse Becker wrote: > I've recently been unable to compile the code in SVN. I've traced it to > revision r890. This apparently adds a check for something related to > Postgres, even when --without-sql is passed to configure, and breaks the > settings in CPPFLAGS. > > Thi

Re: variable name for a usebundle statement: bad?

2010-03-17 Thread Mark Burgess
I looked at this today, and although it could be nice, it cannot currently work as the name's type is checked too soon before variable expansion kicks in. This might be reconsidered one day in the future if it proves useful. Matt Richards wrote: > Greetings: > > This is invalid? I suppose it sh

Re: Defining classes using "dist"

2010-03-17 Thread Mark Burgess
Fixed this issue today in svn. Justin Lloyd wrote: > Mark, > > I just re-read the documentation on this (since I'm going back to fill > in comments in my policy files) and noticed that the notes for dist say > that it assigns "one generic class (always) and ONE additional class" > (emphasis mine

Re: How to replace hosts that change in the /etc/hosts file

2010-03-17 Thread Diego Zamboni
Daniel, I have been working on a similar problem, and came up with the following two bundles for editing files. I think both of these could be used to edit an /etc/hosts file, one by passing the pattern, e.g. edit_line => replace_or_add(".*\s+hostname", "1.2.3.4 hostname") # 1.2.3.4 is the ne

configure.ac error in SVN

2010-03-17 Thread Jesse Becker
I've recently been unable to compile the code in SVN. I've traced it to revision r890. This apparently adds a check for something related to Postgres, even when --without-sql is passed to configure, and breaks the settings in CPPFLAGS. This patch works for me, but I have not tested it on a syste

How to replace hosts that change in the /etc/hosts file

2010-03-17 Thread daniel parkes
Hi, We have a very large /etc/hosts(300 hosts) files in our servers that we have to mantain for certain acient applications, as of now what I have configured in cfengine 3.0.2 is an edit line bundle that reads from a master host file and if the host isn't in the file it adds it. The problem is ju

Re: Deleting local accounts

2010-03-17 Thread Mark Burgess
Don't forget cron/at jobs, spool files, mail etc... nwat...@symcor.com wrote: > I agree with Matt. It is worthy goal but probably much bigger than you > realize. > >> be a great candidate for the COPBL or at least a Cfengine cookbook like >> Neil's. Hmm, I sense an O'reilly book here... :) >

Re: Deleting local accounts

2010-03-17 Thread NWatson
I agree with Matt. It is worthy goal but probably much bigger than you realize. > be a great candidate for the COPBL or at least a Cfengine cookbook like > Neil's. Hmm, I sense an O'reilly book here... :) I can neither confirm nor deny this ;) Sincerely, -- Neil Watson 416-673-3465 CONFIDENT

Re: Deleting local accounts

2010-03-17 Thread Matt Richards
Well, there are lots of things to think about. Unix is not just Linux, there are many more out there and not all the authentication/user situations are the same. You also have to think about Solaris and yellowpages, systems without /etc/shadow, LDAP, DCE, Krb5, etc. The list is endless in the di

Deleting local accounts

2010-03-17 Thread Justin Lloyd
Does anyone have a bundle or set of promises for deleting a local Unix account? I'm thinking about how to approach this cleanly, including removing the user from any groups in /etc/group. I thought about using systems' native commands (e.g. userdel, passmgmt, pwck, pwconv, etc.) but there can be od

Re: process miscounting?

2010-03-17 Thread NWatson
It would be ideal if we could have a policy that would count processes that match and report that number rather than reporting whether or not the count is within a range. We could compare that number with a command policy that would script something like ps -ef|grep cf-execd$ |grep -v grep|wc

Re: cf3.0.4(up to lastest svn) GetVariable hash lookup infinite loop

2010-03-17 Thread Mark Burgess
The fix seems to work, but I remember finding a similar issue at Xmas and fixing it then. I shall put this into svn and everyone should test more to make sure this doesn't just pull the rug out of another corner. Matt Richards wrote: > Greetings, > > I think I hit upon the perfect circumstance

Re: process miscounting?

2010-03-17 Thread Jesse Becker
On Wed, Mar 17, 2010 at 11:30:55AM -0400, Matt Richards wrote: >Good idea. I find the process overcounting more common. In my configuration, I >have a range for the process count and it reports when the process count is >out of range. I will add a "ps -ef" along with the report. It may not catch

Re: process miscounting?

2010-03-17 Thread Matt Richards
Good idea. I find the process overcounting more common. In my configuration, I have a range for the process count and it reports when the process count is out of range. I will add a "ps -ef" along with the report. It may not catch it as it is not run exactly as the same time as the cf process co

/var/cfengine not created during install

2010-03-17 Thread Scott Behrens
Hello, I have recently compiled and installed, cfengine-3.0.4 on CentOS release 5.3. I am following the documentation, but I do not see any directory structure in /var/cfengine on my host (after make; make install). Is there an additional flag I need to run to create this? Thank-you, Scott ___

Re: process miscounting?

2010-03-17 Thread Matt Richards
Good to know. However, I get the miscounting when running cf-exec in the background. It is not just process undercounting, I also see process overcounting. It is very odd, I searched through the code and I can't see how this can happen. I can't figure out how to make a testcase in which this wil

Re: process miscounting?

2010-03-17 Thread NWatson
It's an enigmatic bug to be sure. What about a policy that reports process counts? One commands action to report counts by calling ps and the other using a native process counting promise. After gathering some data we'll at least get an idea of the frequency of the problem. Sincerely, -- Nei

cf3.0.4(up to lastest svn) GetVariable hash lookup infinite loop

2010-03-17 Thread Matt Richards
Greetings, I think I hit upon the perfect circumstance to bust the hash table in GetVariable (vars.c). I believe that the hash table is not going far enough before reseting the increment as I end up in an infinite loop. See the comments "//" below: Debug("GetVariable(%s,%s): using scope '%s' f