Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] chrony logrotate script EOF error
Date: Sun, 22 Aug 2010 14:51:11
Message-Id: 201008221550.52229.michaelkintzios@gmail.com
In Reply to: Re: [gentoo-user] chrony logrotate script EOF error by Alex Schuster
1 On Sunday 22 August 2010 11:25:05 Alex Schuster wrote:
2 > Mick writes:
3 > > The chrony installed logrotate script keeps erroring out:
4 > > ========================================================
5 > > logrotate_script: line 5: warning: here-document at line 2 delimited by
6 > > end- of-file (wanted `EOF')
7 > > Unrecognized command
8 > > ========================================================
9 > >
10 > > This is the script:
11 > > ========================================================
12 > > /var/log/chrony/*.log {
13 > >
14 > > sharedscripts
15 > > postrotate
16 > >
17 > > PASSWORD=`awk '$1 ~ /^1$/ {print $2; exit}'
18 > >
19 > > /etc/chrony/chrony.keys`
20 > >
21 > > cat << EOF | /usr/bin/chronyc | sed '/^200 OK$/d'
22 > > password $PASSWORD
23 > > cyclelogs
24 > > EOF
25 > >
26 > > endscript
27 > >
28 > > }
29 > > ========================================================
30 > >
31 > > I do not understand the error. Is it telling me to add backticks?
32 > > Where?
33 >
34 > I don't know the logrotate syntax, but in bash this would not work if the
35 > ending EOF has leading whitespace. Try replacing the '<<' by '<<-', then
36 > whitespace is allowed.
37
38 Thanks! I've used your suggestion and will see if the error goes away.
39 --
40 Regards,
41 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature