public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] logrotate - strange error message
@ 2010-05-10  7:46 Helmut Jarausch
  2010-05-10  8:31 ` Alan McKinnon
  0 siblings, 1 reply; 5+ messages in thread
From: Helmut Jarausch @ 2010-05-10  7:46 UTC (permalink / raw
  To: gentoo-user

Hi,
I have the following file as /etc/logrotate.d/denyhosts
/var/log/denyhosts {
	missingok
	notifempty
	create 0640 root root
	sharedscripts
	prerotate
		/etc/init.d/denyhosts stop
	endscript
	postrotate
		/etc/init.d/denyhosts start
	endscript
}

But this causes errors
reading config info for /var/log/denyhosts 
error: denyhosts:1 lines must begin with a keyword or a filename (possibly in double quotes)
error: denyhosts:2 unexpected text
error: denyhosts:3 unexpected text
error: denyhosts:4 unexpected text
error: denyhosts:5 unexpected text
error: denyhosts:prerotate or postrotate without endscript

I appreciate any help on this.
Many thanks,
Helmut.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] logrotate - strange error message
  2010-05-10  7:46 [gentoo-user] logrotate - strange error message Helmut Jarausch
@ 2010-05-10  8:31 ` Alan McKinnon
  2010-05-10  9:40   ` Helmut Jarausch
  0 siblings, 1 reply; 5+ messages in thread
From: Alan McKinnon @ 2010-05-10  8:31 UTC (permalink / raw
  To: gentoo-user; +Cc: Helmut Jarausch

On Monday 10 May 2010 09:46:11 Helmut Jarausch wrote:
> Hi,
> I have the following file as /etc/logrotate.d/denyhosts
> /var/log/denyhosts {
> 	missingok
> 	notifempty
> 	create 0640 root root
> 	sharedscripts
> 	prerotate
> 		/etc/init.d/denyhosts stop
> 	endscript
> 	postrotate
> 		/etc/init.d/denyhosts start
> 	endscript
> }
> 
> But this causes errors
> reading config info for /var/log/denyhosts
> error: denyhosts:1 lines must begin with a keyword or a filename (possibly
> in double quotes) error: denyhosts:2 unexpected text
> error: denyhosts:3 unexpected text
> error: denyhosts:4 unexpected text
> error: denyhosts:5 unexpected text
> error: denyhosts:prerotate or postrotate without endscript


That file is correct, so I'd first check the file that is read *before* that 
one, looking for things like missing end braces etc etc

logrotate -d /etc/logrotate.conf will show the read order


-- 
alan dot mckinnon at gmail dot com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] logrotate - strange error message
  2010-05-10  8:31 ` Alan McKinnon
@ 2010-05-10  9:40   ` Helmut Jarausch
  2010-05-10  9:50     ` Alan McKinnon
  0 siblings, 1 reply; 5+ messages in thread
From: Helmut Jarausch @ 2010-05-10  9:40 UTC (permalink / raw
  To: gentoo-user

On 10 May, Alan McKinnon wrote:
> On Monday 10 May 2010 09:46:11 Helmut Jarausch wrote:
>> Hi,
>> I have the following file as /etc/logrotate.d/denyhosts
>> /var/log/denyhosts {
>> 	missingok
>> 	notifempty
>> 	create 0640 root root
>> 	sharedscripts
>> 	prerotate
>> 		/etc/init.d/denyhosts stop
>> 	endscript
>> 	postrotate
>> 		/etc/init.d/denyhosts start
>> 	endscript
>> }
>> 
>> But this causes errors
>> reading config info for /var/log/denyhosts
>> error: denyhosts:1 lines must begin with a keyword or a filename (possibly
>> in double quotes) error: denyhosts:2 unexpected text
>> error: denyhosts:3 unexpected text
>> error: denyhosts:4 unexpected text
>> error: denyhosts:5 unexpected text
>> error: denyhosts:prerotate or postrotate without endscript
> 
> 
> That file is correct, so I'd first check the file that is read *before* that 
> one, looking for things like missing end braces etc etc
> 
> logrotate -d /etc/logrotate.conf will show the read order
> 
> 

Thanks, Alan,

the file before is indeed a bit different

# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v 1.2 2004/07/18 02:25:02 dragonheart Exp $
#
# cups logrotate snippet for Gentoo Linux
#


/var/log/cups/error_log /var/log/cups/access_log /var/log/cups/page_log {
    sharedscripts
    postrotate
        /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
    endscript
}

It has multiple file names in the first line.
Is this OK?

Helmut.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] logrotate - strange error message
  2010-05-10  9:40   ` Helmut Jarausch
@ 2010-05-10  9:50     ` Alan McKinnon
  2010-05-10 11:08       ` Tomáš Linhart
  0 siblings, 1 reply; 5+ messages in thread
From: Alan McKinnon @ 2010-05-10  9:50 UTC (permalink / raw
  To: gentoo-user; +Cc: Helmut Jarausch

On Monday 10 May 2010 11:40:29 Helmut Jarausch wrote:
> On 10 May, Alan McKinnon wrote:
> > On Monday 10 May 2010 09:46:11 Helmut Jarausch wrote:
> >> Hi,
> >> I have the following file as /etc/logrotate.d/denyhosts
> >> /var/log/denyhosts {
> >> 
> >> 	missingok
> >> 	notifempty
> >> 	create 0640 root root
> >> 	sharedscripts
> >> 	prerotate
> >> 	
> >> 		/etc/init.d/denyhosts stop
> >> 	
> >> 	endscript
> >> 	postrotate
> >> 	
> >> 		/etc/init.d/denyhosts start
> >> 	
> >> 	endscript
> >> 
> >> }
> >> 
> >> But this causes errors
> >> reading config info for /var/log/denyhosts
> >> error: denyhosts:1 lines must begin with a keyword or a filename
> >> (possibly in double quotes) error: denyhosts:2 unexpected text
> >> error: denyhosts:3 unexpected text
> >> error: denyhosts:4 unexpected text
> >> error: denyhosts:5 unexpected text
> >> error: denyhosts:prerotate or postrotate without endscript
> > 
> > That file is correct, so I'd first check the file that is read *before*
> > that one, looking for things like missing end braces etc etc
> > 
> > logrotate -d /etc/logrotate.conf will show the read order
> 
> Thanks, Alan,
> 
> the file before is indeed a bit different
> 
> # $Header:
> /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v
> 1.2 2004/07/18 02:25:02 dragonheart Exp $ #
> # cups logrotate snippet for Gentoo Linux
> #
> 
> 
> /var/log/cups/error_log /var/log/cups/access_log /var/log/cups/page_log {
>     sharedscripts
>     postrotate
>         /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
>     endscript
> }
> 
> It has multiple file names in the first line.
> Is this OK?

Yes, that's fine - logrotate supports that.

Please hash out all the lines in the denyhosts rotate file and run 
"logrotate -d /etc/logrotate.conf"
Then let's see what error comes up.

-- 
alan dot mckinnon at gmail dot com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] logrotate - strange error message
  2010-05-10  9:50     ` Alan McKinnon
@ 2010-05-10 11:08       ` Tomáš Linhart
  0 siblings, 0 replies; 5+ messages in thread
From: Tomáš Linhart @ 2010-05-10 11:08 UTC (permalink / raw
  To: gentoo-user

2010/5/10 Alan McKinnon <alan.mckinnon@gmail.com>:
> Please hash out all the lines in the denyhosts rotate file and run
> "logrotate -d /etc/logrotate.conf"
> Then let's see what error comes up.
>
> --
> alan dot mckinnon at gmail dot com
>
>

I hit the same problem few days ago but I didn't look for a solution
until today.
When I tried to run logrotate -d /etc/logrotate.d/denyhosts, it still
fails with the same error.

Finally I took a close look at the file /etc/logrotate.d/denyhosts and
I discovered that it contains CRLF as line separators. Converting them
to LF has solved the problem.

I just file a bug about it. See http://bugs.gentoo.org/show_bug.cgi?id=319133

Hope this helps.

Tomáš



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-10 11:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-10  7:46 [gentoo-user] logrotate - strange error message Helmut Jarausch
2010-05-10  8:31 ` Alan McKinnon
2010-05-10  9:40   ` Helmut Jarausch
2010-05-10  9:50     ` Alan McKinnon
2010-05-10 11:08       ` Tomáš Linhart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox