1 |
On Monday 10 May 2010 11:40:29 Helmut Jarausch wrote: |
2 |
> On 10 May, Alan McKinnon wrote: |
3 |
> > On Monday 10 May 2010 09:46:11 Helmut Jarausch wrote: |
4 |
> >> Hi, |
5 |
> >> I have the following file as /etc/logrotate.d/denyhosts |
6 |
> >> /var/log/denyhosts { |
7 |
> >> |
8 |
> >> missingok |
9 |
> >> notifempty |
10 |
> >> create 0640 root root |
11 |
> >> sharedscripts |
12 |
> >> prerotate |
13 |
> >> |
14 |
> >> /etc/init.d/denyhosts stop |
15 |
> >> |
16 |
> >> endscript |
17 |
> >> postrotate |
18 |
> >> |
19 |
> >> /etc/init.d/denyhosts start |
20 |
> >> |
21 |
> >> endscript |
22 |
> >> |
23 |
> >> } |
24 |
> >> |
25 |
> >> But this causes errors |
26 |
> >> reading config info for /var/log/denyhosts |
27 |
> >> error: denyhosts:1 lines must begin with a keyword or a filename |
28 |
> >> (possibly in double quotes) error: denyhosts:2 unexpected text |
29 |
> >> error: denyhosts:3 unexpected text |
30 |
> >> error: denyhosts:4 unexpected text |
31 |
> >> error: denyhosts:5 unexpected text |
32 |
> >> error: denyhosts:prerotate or postrotate without endscript |
33 |
> > |
34 |
> > That file is correct, so I'd first check the file that is read *before* |
35 |
> > that one, looking for things like missing end braces etc etc |
36 |
> > |
37 |
> > logrotate -d /etc/logrotate.conf will show the read order |
38 |
> |
39 |
> Thanks, Alan, |
40 |
> |
41 |
> the file before is indeed a bit different |
42 |
> |
43 |
> # $Header: |
44 |
> /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v |
45 |
> 1.2 2004/07/18 02:25:02 dragonheart Exp $ # |
46 |
> # cups logrotate snippet for Gentoo Linux |
47 |
> # |
48 |
> |
49 |
> |
50 |
> /var/log/cups/error_log /var/log/cups/access_log /var/log/cups/page_log { |
51 |
> sharedscripts |
52 |
> postrotate |
53 |
> /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true |
54 |
> endscript |
55 |
> } |
56 |
> |
57 |
> It has multiple file names in the first line. |
58 |
> Is this OK? |
59 |
|
60 |
Yes, that's fine - logrotate supports that. |
61 |
|
62 |
Please hash out all the lines in the denyhosts rotate file and run |
63 |
"logrotate -d /etc/logrotate.conf" |
64 |
Then let's see what error comes up. |
65 |
|
66 |
-- |
67 |
alan dot mckinnon at gmail dot com |