File tree 3 files changed +51
-0
lines changed
3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -7,5 +7,23 @@ sed -i \
7
7
/etc/logstash/logstash.yml
8
8
chmod 600 /etc/logstash/startup.options
9
9
chmod 600 /etc/default/logstash
10
+
11
+ # Starting from systemd 229, TimeouStopSec supports using
12
+ # 'infinity' to disable not send a SIG Kill.
13
+ #
14
+ # Older versions need to use 0 instead.
15
+ systemd_version=$( rpm -q systemd 2> /dev/null | cut -d ' -' -f2)
16
+ if [ -n $systemd_version ] && [ $systemd_version -lt 229 ]; then
17
+ sed -i \
18
+ -e " s/^TimeoutStopSec=infinity/TimeoutStopSec=0/" \
19
+ /lib/systemd/system/logstash.service || true
20
+ else
21
+ # Ensure's an upgraded system has the right setting, if it
22
+ # wasn't automatically replaced by the OS.
23
+ sed -i \
24
+ -e " s/^TimeoutStopSec=0/TimeoutStopSec=infinity/" \
25
+ /lib/systemd/system/logstash.service || true
26
+ fi
27
+
10
28
# Ensure the init script is picked up by systemd
11
29
systemctl daemon-reload 2> /dev/null || true
Original file line number Diff line number Diff line change @@ -11,3 +11,19 @@ sed -i \
11
11
chmod 600 /etc/logstash/startup.options
12
12
chmod 600 /etc/default/logstash
13
13
14
+ # Starting from systemd 229, TimeouStopSec supports using
15
+ # 'infinity' to disable not send a SIG Kill.
16
+ #
17
+ # Older versions need to use 0 instead.
18
+ systemd_version=$( dpkg-query --showformat=' ${Version}' --show systemd 2> /dev/null)
19
+ if [ -n $systemd_version ] && dpkg --compare-versions " $systemd_version " lt 229 ; then
20
+ sed -i \
21
+ -e " s/^TimeoutStopSec=infinity/TimeoutStopSec=0/" \
22
+ /lib/systemd/system/logstash.service || true
23
+ else
24
+ # Ensure's an upgraded system has the right setting, if it
25
+ # wasn't automatically replaced by the OS.
26
+ sed -i \
27
+ -e " s/^TimeoutStopSec=0/TimeoutStopSec=infinity/" \
28
+ /lib/systemd/system/logstash.service || true
29
+ fi
Original file line number Diff line number Diff line change @@ -9,3 +9,20 @@ sed -i \
9
9
/etc/logstash/logstash.yml
10
10
chmod 600 /etc/logstash/startup.options
11
11
chmod 600 /etc/default/logstash
12
+
13
+ # Starting from systemd 229, TimeouStopSec supports using
14
+ # 'infinity' to disable not send a SIG Kill.
15
+ #
16
+ # Older versions need to use 0 instead.
17
+ systemd_version=$( dpkg-query --showformat=' ${Version}' --show systemd 2> /dev/null)
18
+ if [ -n $systemd_version ] && dpkg --compare-versions " $systemd_version " lt 229 ; then
19
+ sed -i \
20
+ -e " s/^TimeoutStopSec=infinity/TimeoutStopSec=0/" \
21
+ /lib/systemd/system/logstash.service || true
22
+ else
23
+ # Ensure's an upgraded system has the right setting, if it
24
+ # wasn't automatically replaced by the OS.
25
+ sed -i \
26
+ -e " s/^TimeoutStopSec=0/TimeoutStopSec=infinity/" \
27
+ /lib/systemd/system/logstash.service || true
28
+ fi
You can’t perform that action at this time.
0 commit comments