Skip to content

Commit c271020

Browse files
committed
Remove SysV init support
With the removal of support for older OSes, we no longer have any supported systems which use SysV init. This commit removes support for that legacy init system. relates elastic#51480
1 parent b03647e commit c271020

26 files changed

+6
-688
lines changed

distribution/packages/build.gradle

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,6 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) {
236236
fileMode 0755
237237
}
238238

239-
// ========= sysV init =========
240-
configurationFile '/etc/init.d/elasticsearch'
241-
into('/etc/init.d') {
242-
fileMode 0750
243-
fileType CONFIG | NOREPLACE
244-
from "${packagingFiles}/init.d/elasticsearch"
245-
}
246-
247239
// ========= empty dirs =========
248240
// NOTE: these are created under packagingFiles as empty, but the permissions are set here
249241
Closure copyEmptyDir = { path, u, g, mode ->

distribution/packages/src/common/env/elasticsearch

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,3 @@ ES_PATH_CONF=${path.conf}
1919

2020
# Configure restart on package upgrade (true, every other setting will lead to not restarting)
2121
#RESTART_ON_UPGRADE=true
22-
23-
################################
24-
# Elasticsearch service
25-
################################
26-
27-
# SysV init.d
28-
#
29-
# The number of seconds to wait before checking if Elasticsearch started successfully as a daemon process
30-
ES_STARTUP_SLEEP_TIME=5
31-
32-
################################
33-
# System properties
34-
################################
35-
36-
# Specifies the maximum file descriptor number that can be opened by this process
37-
# When using Systemd, this setting is ignored and the LimitNOFILE defined in
38-
# /usr/lib/systemd/system/elasticsearch.service takes precedence
39-
#MAX_OPEN_FILES=65535
40-
41-
# The maximum number of bytes of memory that may be locked into RAM
42-
# Set to "unlimited" if you use the 'bootstrap.memory_lock: true' option
43-
# in elasticsearch.yml.
44-
# When using systemd, LimitMEMLOCK must be set in a unit file such as
45-
# /etc/systemd/system/elasticsearch.service.d/override.conf.
46-
#MAX_LOCKED_MEMORY=unlimited
47-
48-
# Maximum number of VMA (Virtual Memory Areas) a process can own
49-
# When using Systemd, this setting is ignored and the 'vm.max_map_count'
50-
# property is set at boot time in /usr/lib/sysctl.d/elasticsearch.conf
51-
#MAX_MAP_COUNT=262144

distribution/packages/src/common/scripts/postinst

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -62,40 +62,13 @@ if [ "x$IS_UPGRADE" != "xtrue" ]; then
6262
echo " sudo systemctl enable elasticsearch.service"
6363
echo "### You can start elasticsearch service by executing"
6464
echo " sudo systemctl start elasticsearch.service"
65-
66-
elif command -v chkconfig >/dev/null; then
67-
echo "### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using chkconfig"
68-
echo " sudo chkconfig --add elasticsearch"
69-
echo "### You can start elasticsearch service by executing"
70-
echo " sudo service elasticsearch start"
71-
72-
elif command -v update-rc.d >/dev/null; then
73-
echo "### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using chkconfig"
74-
echo " sudo update-rc.d elasticsearch defaults 95 10"
75-
echo "### You can start elasticsearch service by executing"
76-
echo " sudo /etc/init.d/elasticsearch start"
7765
fi
7866
elif [ "$RESTART_ON_UPGRADE" = "true" ]; then
7967

8068
echo -n "Restarting elasticsearch service..."
8169
if command -v systemctl >/dev/null; then
8270
systemctl daemon-reload
8371
systemctl restart elasticsearch.service || true
84-
85-
elif [ -x /etc/init.d/elasticsearch ]; then
86-
if command -v invoke-rc.d >/dev/null; then
87-
invoke-rc.d elasticsearch stop || true
88-
invoke-rc.d elasticsearch start || true
89-
else
90-
/etc/init.d/elasticsearch restart || true
91-
fi
92-
93-
# older suse linux distributions do not ship with systemd
94-
# but do not have an /etc/init.d/ directory
95-
# this tries to start the elasticsearch service on these
96-
# as well without failing this script
97-
elif [ -x /etc/rc.d/init.d/elasticsearch ] ; then
98-
/etc/rc.d/init.d/elasticsearch restart || true
9972
fi
10073
echo " OK"
10174
fi

distribution/packages/src/common/scripts/prerm

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,6 @@ if [ "$STOP_REQUIRED" = "true" ]; then
5454
echo -n "Stopping elasticsearch service..."
5555
if command -v systemctl >/dev/null; then
5656
systemctl --no-reload stop elasticsearch.service
57-
58-
elif [ -x /etc/init.d/elasticsearch ]; then
59-
if command -v invoke-rc.d >/dev/null; then
60-
invoke-rc.d elasticsearch stop
61-
else
62-
/etc/init.d/elasticsearch stop
63-
fi
64-
65-
# older suse linux distributions do not ship with systemd
66-
# but do not have an /etc/init.d/ directory
67-
# this tries to start the elasticsearch service on these
68-
# as well without failing this script
69-
elif [ -x /etc/rc.d/init.d/elasticsearch ] ; then
70-
/etc/rc.d/init.d/elasticsearch stop
7157
fi
7258
echo " OK"
7359
fi

distribution/packages/src/deb/init.d/elasticsearch

Lines changed: 0 additions & 171 deletions
This file was deleted.

distribution/packages/src/deb/lintian/elasticsearch

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,13 @@ non-standard-dir-perm etc/elasticsearch/ 2750 != 0755
1919
non-standard-file-perm etc/elasticsearch/*
2020
non-standard-dir-perm var/lib/elasticsearch/ 2750 != 0755
2121
non-standard-dir-perm var/log/elasticsearch/ 2750 != 0755
22-
executable-is-not-world-readable etc/init.d/elasticsearch 0750
23-
non-standard-file-permissions-for-etc-init.d-script etc/init.d/elasticsearch 0750 != 0755
2422

2523
# this lintian tag is simply wrong; contrary to the explanation, debian systemd
2624
# does actually look at /usr/lib/systemd/system
2725
systemd-service-file-outside-lib usr/lib/systemd/system/elasticsearch.service
2826

29-
# we do not automatically enable the service in init.d or systemd
30-
script-in-etc-init.d-not-registered-via-update-rc.d etc/init.d/elasticsearch
31-
32-
# the package scripts handle init.d/systemd directly and don't need to use deb helpers
27+
# the package scripts handle systemd directly and don't need to use deb helpers
3328
maintainer-script-calls-systemctl
34-
prerm-calls-updaterc.d elasticsearch
3529

3630
# bundled JDK
3731
embedded-library

0 commit comments

Comments
 (0)