Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] chrony logrotate script EOF error
Date: Sun, 22 Aug 2010 10:25:37
Message-Id: 201008221225.06183.wonko@wonkology.org
In Reply to: [gentoo-user] chrony logrotate script EOF error by Mick
1 Mick writes:
2
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 > sharedscripts
14 > postrotate
15 > PASSWORD=`awk '$1 ~ /^1$/ {print $2; exit}'
16 > /etc/chrony/chrony.keys`
17 > cat << EOF | /usr/bin/chronyc | sed '/^200 OK$/d'
18 > password $PASSWORD
19 > cyclelogs
20 > EOF
21 > endscript
22 > }
23 > ========================================================
24 >
25 > I do not understand the error. Is it telling me to add backticks?
26 > Where?
27
28 I don't know the logrotate syntax, but in bash this would not work if the
29 ending EOF has leading whitespace. Try replacing the '<<' by '<<-', then
30 whitespace is allowed.
31
32 Wonko

Replies

Subject Author
Re: [gentoo-user] chrony logrotate script EOF error Mick <michaelkintzios@×××××.com>