Fixes the system unit TimeoutStopSec option to set 0 on older version that do not support 'infinity'.
Also handles the upgrade case where the OS may not automatically upgrade the systemd file.
During upgrade, Logstash packaging removes /etc/systemd/system/logstash.service because Logstahs used to install the systemd unit there. However, this could have been modified by the user by overriding the systemd file. As such, the upgrade process should only remove if it is certain it wasn't installed by Logstash.
Unfortunately, there's no particular way to determine if Logstash installation process installed the file because it was done on the fly, by a script, on a postinst script of the package.
As such, the best way to address this is to check if both the new and the old file exists. If the new one doesn't exist, we can assume we are upgrading (or installing afresh), and the old file should be removed. If the new one exists and the user-create one (old location) also exists, we assume it is user created, and as such, we don't remove it just to be safe.
Fixes the CentOS package installation to ensure that if both the systemd unit and sys-v init script are installed, the “service” command a prefers systemd.
This change removes the usage of 'pleaserun', which
was leveraged create the init.d scripts or systemd units.
Now, we ship init.d scripts and systemd units to make
the maintenance easier and following the lead of the
other Elastic projects.
Fixes: #10519, Fixes: #12439, Fixes: #8253
This change keeps the previous behavior but implements it using multiple
pipelines (pipelines.yml) instead of with `path.config`.
* The default pipeline name is still "main"
* Default config path is still /etc/logstash/conf.d/*.conf
Other small changes included:
* Specify fpm workdir. Otherwise rpmbuild is given an empty value for
its temporary directory. It's unclear if this is a bug in fpm or in my
environment, but I like the change anyway to put fpm's build activity
in the build directory.
* DRY's up the common files going in /etc/logstash for both rpm and deb
packages.
For #8893Fixes#8894
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.
This fix is for packages only (RPM/DEB)
This puts the requisite changes into /etc/logstash/logstash.yml so that starting logstash from the command-line, e.g. `/usr/share/logstash/bin/logstash --path.settings /etc/logstash` will read the pipeline from `/etc/logstash/conf.d` and log to `/var/log/logstash/logstash.log`.
fixes#5379
Comment out tmpdir in jvm.options
The absence of the tmpdir can cause JRuby to fail
Fixes#5383
Update after-install scripts
Use /usr/lib/logstash instead of /opt/logstash
More revisions.
Using `/usr/share/logstash` instead of `/usr/lib/logstash`
Track these new files
More work in progress.
Proper arg parsing obtained
WIP: Use jvm.options like ES
Remove facter dependency
Due to an update from @jordansissel on pleaserun, facter is no longer necessary
Revert Gemfile to proper version
Latest work in progress.
I added a simple test to logstash.lib.sh to catch empty strings in java options.
Added `startup.options`, and touched up `jvm.options`
Edited the package scripts to make things play nice with new paths.
Tweaked `system-install` to allow users to provide their own `startup.options` file.
Patch up merge failure
Changes to work with the new logstash.yml
Add fpm dependency (build fails without it)
Fix missing gems in Gemfile
Don't know how these got lost
Use /etc/logstash for configuration in packages
Update the instructions/documentation for...
...startup.options
Merging proposed changes
Remove mustache and clamp
They're covered by pleaserun anyway
Prune config dir from /usr/share/logstash...
...but only when using RPM/DEB packages
Fixes#5341
In cases where $KILL_ON_STOP_TIMEOUT is undefined, getting to line 99 will generate the following error:
```
/etc/init.d/logstash: line 99: [: : integer expression expected
```
I'm no shell scripting expert, but from some tinkering I landed upon changing
```
if [ "$KILL_ON_STOP_TIMEOUT" -eq 1 ] ;
```
to
```
if [[ $KILL_ON_STOP_TIMEOUT -eq 1 ]] ;
```
which appears to work for me.
Also, logstash often takes longer than 5 seconds to shut down for me, so adding a few more seconds to the countdown on line 93 might help.
Might fix https://github.com/elastic/logstash/issues/4457Fixes#4732
No need to export all the JAVA* related environment variables
for configtest. It needs a minimal set of variables to execute
bin/logstash --config-test. This was indirectly causing issues
when used with JMX options in LS_JAVA_OPTS. JMX needs a remote port defined
and configtest was trying to connect to the port twice which caused
restart (#4319) to fail
Fixes#4319Fixes#4759
It should come before the `-f`, otherwise Logstash might bind a port and
start running, rather than only perform a configtest, then exit.
fixes 4737
Fixes#4738
In some cases it seems that the file permissions for the logrotate
configuration file are not set properly. This should address those
cases.
Fixes#4136
In some cases it seems that the file permissions for the logrotate
configuration file are not set properly. This should address those
cases.
fixes#3490Fixes#4135
This should fix a test failure on CentOS 6 where 'emit' gives 'command
not found' which, as the last command run in stop(), causes stop() to
always return exit code 127.
Fixes#3614
updated the packaged to enable JAVA_OPTS to override the defaults
ammended JAVA_OPTS being exported
ammend warning wording
ammend the last commit
fix wording again
Fixes#2942
remove stale code
cleanup the bash conditions for when a variable is defined or not
make sure LS_JAVA_OPTS override JAVA_OPTS when need
ammend unused var
rollback to previous use case of appending vars to JAVA_OPTS in the case of having LS_JAVA_OPTS
Fixes#2942
All internal references, flags, kibana, vendor, everything must go!
If it referenced kibana or logstash-web, it is deprecated, and removed!
Operators are standing by...
Fixes#2661