[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problems with LocateLineMatching regex
From: |
Jamie Wilkinson |
Subject: |
problems with LocateLineMatching regex |
Date: |
Fri, 1 Aug 2003 16:28:05 +1000 |
User-agent: |
Mutt/1.5.4i |
I'm having some problems getting a regex to match a line in a logrotate
config file.
The editfiles section looks like this:
{ /etc/logrotate.d/httpd
Backup 'off'
LocateLineMatching 'httpd.*log[:space:]+\{[:space:]*$'
BeginGroupifNoMatch '^/var/log/httpd/\*_log /var/log/httpd/\*\*_log \{$'
ReplaceLineWith '/var/log/httpd/*_log /var/log/httpd/*/*_log {'
EndGroup
}
and the file in question looks like:
/var/log/httpd/*log {
missingok
notifempty
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2>/dev/null ||true
endscript
}
(default /etc/logrotate.d/httpd from Red Hat 9)
Nothing happens to the file, and the following message appears when cfagent
is run in verbose mode:
Begin editing /etc/logrotate.d/httpd
Edit: Search for httpd.*log[:space:]+\{[:space:]*$ failed. Current line
still 1
LocateLineMatchingRegexp failed in /etc/logrotate.d/httpd, aborting editing
End editing /etc/logrotate.d/httpd
Interestingly, if I change the first regex to just '\{$' the search also
fails. There is no space between the { and the end of line in the actual
file. A regex of '[{]$' also fails.
I am using cfengine 2.0.4 on this machine; I have not yet had time to
upgrade my cfengine RPMs for my network unfortunately.
Any ideas?
--
jaq@spacepants.org http://spacepants.org/jaq.gpg
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- problems with LocateLineMatching regex,
Jamie Wilkinson <=