logstash/pkg/centos/after-install.sh
Daniel Riegel 24c595a57b Update after-install.sh - fix log file permissions (#5737)
Update after-install.sh - fix log file permissions

When installing Logstash (after previous removal of the Logstash RPM), there is a chance that there are old log files without proper owner.
Running Logstash as service, it may want to append data to these log files. Consequently, the logstash service does not start because it doesn't have write permissions to that files. This patch sets the (new) user logstash to own these historic files.
2016-08-09 08:32:07 -07:00

10 lines
449 B
Bash

chown -R logstash:logstash /usr/share/logstash
chown -R logstash /var/log/logstash
chown logstash:logstash /var/lib/logstash
chmod 0644 /etc/logrotate.d/logstash
sed -i \
-e 's|# path.config:|path.config: /etc/logstash/conf.d|' \
-e 's|# path.log:|path.log: /var/log/logstash/logstash.log|' \
-e 's|# path.data:|path.data: /var/lib/logstash|' \
/etc/logstash/logstash.yml
/usr/share/logstash/bin/system-install /etc/logstash/startup.options