[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Stumped on editfiles problem
From: |
Wheeler, John |
Subject: |
RE: Stumped on editfiles problem |
Date: |
Thu, 21 Aug 2003 11:10:15 -0500 |
Not that it helps you, but two of the five work for me on cfengine 2.0.6
solaris 2.8
control:
actionsequence = (
editfiles
)
IfElapsed = ( 0 )
editfiles:
{ /etc/inetd.conf
# works CommentLinesMatching "^\<daytime\>.*"
# works CommentLinesMatching "^daytime\>.*"
# doesn't work CommentLinesMatching "^daytime\W+.*"
# dosen't work CommentLinesMatching "^daytime[:space:].*"
# dosen't work CommentLinesMatching "^daytime\b.*"
}
-----Original Message-----
From: Steve Ferguson [mailto:sfergus1@mindspring.com]
Sent: Thursday, August 21, 2003 11:00 AM
To: Wheeler, John
Subject: RE: Stumped on editfiles problem
2.0.7p3
Steve
On Thu, 21 Aug 2003, Wheeler, John wrote:
> What version of cfengine?
>
> -----Original Message-----
> From: Steve Ferguson [mailto:sfergus1@mindspring.com]
> Sent: Wednesday, August 20, 2003 10:24 AM
> To: help-cfengine@gnu.org
> Subject: Re: Stumped on editfiles problem
>
> NOTE: For some reason I haven't seen my last two messages go out on
the
> help-cfengine list, so I'm trying to repost them (combined here) from
a
> different address.
>
> Steve
>
> =====
>
> It seems that this is boiling down to more of my ignorance of the
> nuances of cfengine's regex parser. I still don't understand why one
> expression will work on a Solaris 8 box, and not on a 2.6 box, but
let's
> ignore that for the moment. Here is one regex that works on the 2.6
> box:
>
> CommentLinesMatching "^daytime.*"
>
> I don't like this one because it doesn't extend to the general case.
I
> at least want to match a right-most word boundary, because a string
like
> "time" might match something like "timer" or another longer string I
may
> want to keep enabled. I can't figure out how to get a rightmost word
> boundary match. Here's stuff that doesn't result in a match, and I
> don't understand why:
>
> CommentLinesMatching "^\<daytime\>.*"
> CommentLinesMatching "^daytime\>.*"
> CommentLinesMatching "^daytime\W+.*"
> CommentLinesMatching "^daytime[:space:].*"
> CommentLinesMatching "^daytime\b.*"
>
> Plugging similar expressions into Perl results in a match.
>
> root:cfengine# perl -ne 'print if /^daytime\b.*/;' /etc/inetd.conf
> daytime stream tcp nowait root internal
> daytime dgram udp wait root internal
> root:cfengine# perl -ne 'print if /^daytime\W+.*/;' /etc/inetd.conf
> daytime stream tcp nowait root internal
> daytime dgram udp wait root internal
>
> So I'm missing some key piece about the regexes in cfengine.
>
> I don't want to use my first solution, because as I mentioned that
> doesn't limit my match to the entire first field.
>
> Help?
>
> Thanks,
> Steve
>
>
> > -----Original Message-----
> > From: Ferguson, Steve
> > Sent: Tuesday, August 19, 2003 1:50 PM
> > To: 'help-cfengine@gnu.org'
> > Subject: Stumped on editfiles problem
> >
> >
> > I'm running the same configuration on a Solaris 8 and a 2.6
> > system. This works as expected on the 8 system, but does
> > nothing on the 2.6 box.
> >
> > editfiles:
> > { /etc/inetd.conf
> > SetCommentStart "#"
> > CommentLinesMatching "^\<daytime\>.*"
> > DefineClasses "HupInetd"
> > }
> >
> > The relevant lines from inetd.conf look like this on the 2.6
> > box (default shipped with 2.6):
> >
> > daytime stream tcp nowait root internal
> > daytime dgram udp wait root internal
> >
> > They looks like this on the 8 system:
> >
> > daytime stream tcp6 nowait root internal
> > daytime dgram udp6 wait root internal
> >
> > Running on the 8 box in debug mode, I see this:
> >
> > Edit action: CommentLinesMatching
> > Commenting #daytime stream tcp6 nowait root internal
> > Commenting #daytime dgram udp6 wait root internal
> >
> > On the 2.6 box I don't see any "Commenting" actions in the
> > debug output.
> >
> > Begin editing /etc/./inet/inetd.conf
> > Edit action: SetCommentStart
> > Edit action: CommentLinesMatching
> > Edit action: DefineClasses
> >
> > I've even tried copying inetd.conf from the 8 box to the 2.6
> > box, just to be certain I didn't have any sort of bizarre
> > embedded unprintable characters in the file (od didn't show
> > any). So I have the same config section and the same target
> > file, but on one system cfengine will make the change and on
> > the other it won't.
> >
> > I'm stumped. Any suggestions on what I'm missing?
> >
> > Thanks,
> > Steve
> >
> > PS. I'm having the same "no op" issue on ALL of my DEC boxes
> > too. I don't care about them yet, because I haven't been
> > able to get cfservd to run successfully there yet. It's just
> > an additional data point.
> >
> > --
> > Steve Ferguson
> > gedas USA, Inc.
> > Steve.Ferguson@gedas.com
> > http://www.gedasusa.com
>
>
--
Steve Ferguson | "There are two rules for
Email: sfergus1@mindspring.com | survival in this universe:
http://dogbert.dnsalias.org:8080/~stf | (1.) Don't tell everything
| you know." -- Anonymous
RE: Stumped on editfiles problem, Martin John P.-r50845, 2003/08/27