Bug 12948 - logrotate_script: 4: logrotate_script: Syntax error: "then" unexpected
Summary: logrotate_script: 4: logrotate_script: Syntax error: "then" unexpected
Status: RESOLVED INVALID
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other (show other bugs)
Version: 4.6.5
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-07 07:12 UTC by patrikx3
Modified: 2017-08-07 07:57 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description patrikx3 2017-08-07 07:12:54 UTC
Ciao!

How are you?
Sorry to bother you!

Just I am getting this error:
logrotate_script: 4: logrotate_script: Syntax error: "then" unexpected (expecting "fi")
error: error running non-shared postrotate script for /var/log/samba/log.samba of '/var/log/samba/log.samba '
run-parts: /etc/cron.daily/logrotate exited with return code 1

I guess it is here: 
/var/log/samba/log.samba {
        weekly
        missingok
        rotate 7
        postrotate
                if [ -d /run/systemd/system ] && command systemctl >/dev/null 2>&1 && systemctl is-active --quiet samba$
                         systemctl kill --kill-who all --signal=SIGHUP samba-ad-dc
                elsif [ -f /var/run/samba/samba.pid ]; then
                        # This only sends to main pid, See #803924
                        kill -HUP `cat /var/run/samba/samba.pid`
                fi
        endscript
        compress
        delaycompress
        notifempty
}

I guess I can fix it, just let you know a small issue. Though you have many.

Have good day!
Comment 1 Stefan Metzmacher 2017-08-07 07:57:47 UTC
(In reply to patrikx3 from comment #0)

It seems this is some script from distribution packages,
it's not part of the upstream samba.org tree.

Please open a bug in the bug tracker of your distribution.

Thanks!