Logrotate not restarting rsyslog

logrotate is not sending HUP signal to rsyslog because of invalid
command in postrotate/endscript block. Fixed the command to reload
the rsyslog after the logs are rotated.

Change-Id: Ia1fa205e6f20c212841109c914a8c7e2d379a48b
This commit is contained in:
Ravi Kumar Boyapati 2017-02-25 12:16:08 -05:00
parent c902307da5
commit c63290a0a4
3 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,7 @@
{% if rsyslog_client_log_rotate_scripts | length > 0 %}
{% for script in rsyslog_client_log_rotate_scripts %}
{{ script.name }}
{{ script.content }}
{{ script.content | default(rsyslog_client_reload) }}
endscript
{% endfor %}
{% endif %}

View File

@ -20,3 +20,5 @@
rsyslog_client_distro_packages:
- rsyslog
- logrotate
rsyslog_client_reload: 'invoke-rc.d rsyslog rotate > /dev/null || true'

View File

@ -16,3 +16,5 @@
rsyslog_client_distro_packages:
- rsyslog
- logrotate
rsyslog_client_reload: '/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true'