elastic / elastic/logstash

Logstash fails to install if logrotate file is missing

Open
#5,597 2 comments 0 reactions 0 assignees View on GitHub
packaging
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
19h 14m
Merged PRs (30d)
63

Description

Firstly, I apologize as I am not sure that this is the correct place to file packaging-related bugs...

It seems that the post-installation script for the `logstash` package is too strict with regards to the existance of the `/etc/logrotate.d/logstash` file. The script is currently as follows:

```
#!/bin/sh

chown -R logstash:logstash /opt/logstash
chown logstash /var/log/logstash
chown logstash:logstash /var/lib/logstash
chmod 0644 /etc/logrotate.d/logstash
```

On our installation (which is managed by Puppet) we removed the default (daily) `logrotate` rule and used an hourly `logrotate` rule instead. As such, `/etc/logrotate.d/logstash` does not exist (but `/etc/logrotate.d/hourly/logstash` does).

The problem here is that upgrading the `logstash` package now fails:

```
> sudo apt-get install --reinstall logstash
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 144 not upgraded.
Need to get 0 B/79.8 MB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 73755 files and directories currently installed.)
Preparing to unpack .../logstash_1%3a2.3.3-1_all.deb ...
Unpacking logstash (1:2.3.3-1) over (1:2.3.3-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up logstash (1:2.3.3-1) ...
chmod: cannot access ‘/etc/logrotate.d/logstash’: No such file or directory
dpkg: error processing package logstash (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
logstash
E: Sub-process /usr/bin/dpkg returned an error code (1)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.