Skip to content

Commit 2899e03

Browse files
authored
Remove SysV init support (#51716)
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 #51480
1 parent 1cd1727 commit 2899e03

26 files changed

+7
-711
lines changed

distribution/packages/build.gradle

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,6 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
253253
fileMode 0755
254254
}
255255

256-
// ========= sysV init =========
257-
configurationFile '/etc/init.d/elasticsearch'
258-
into('/etc/init.d') {
259-
fileMode 0750
260-
fileType CONFIG | NOREPLACE
261-
from "${packagingFiles}/init.d/elasticsearch"
262-
}
263-
264256
// ========= empty dirs =========
265257
// NOTE: these are created under packagingFiles as empty, but the permissions are set here
266258
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
@@ -20,33 +20,3 @@ ES_PATH_CONF=${path.conf}
2020

2121
# Configure restart on package upgrade (true, every other setting will lead to not restarting)
2222
#RESTART_ON_UPGRADE=true
23-
24-
################################
25-
# Elasticsearch service
26-
################################
27-
28-
# SysV init.d
29-
#
30-
# The number of seconds to wait before checking if Elasticsearch started successfully as a daemon process
31-
ES_STARTUP_SLEEP_TIME=5
32-
33-
################################
34-
# System properties
35-
################################
36-
37-
# Specifies the maximum file descriptor number that can be opened by this process
38-
# When using Systemd, this setting is ignored and the LimitNOFILE defined in
39-
# /usr/lib/systemd/system/elasticsearch.service takes precedence
40-
#MAX_OPEN_FILES=65535
41-
42-
# The maximum number of bytes of memory that may be locked into RAM
43-
# Set to "unlimited" if you use the 'bootstrap.memory_lock: true' option
44-
# in elasticsearch.yml.
45-
# When using systemd, LimitMEMLOCK must be set in a unit file such as
46-
# /etc/systemd/system/elasticsearch.service.d/override.conf.
47-
#MAX_LOCKED_MEMORY=unlimited
48-
49-
# Maximum number of VMA (Virtual Memory Areas) a process can own
50-
# When using Systemd, this setting is ignored and the 'vm.max_map_count'
51-
# property is set at boot time in /usr/lib/sysctl.d/elasticsearch.conf
52-
#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: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,7 @@ esac
5353
if [ "$STOP_REQUIRED" = "true" ]; then
5454
echo -n "Stopping elasticsearch service..."
5555
if command -v systemctl >/dev/null; then
56-
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
56+
systemctl --no-reload stop elasticsearch.service || true
7157
fi
7258
echo " OK"
7359
fi
@@ -82,14 +68,6 @@ if [ "$REMOVE_SERVICE" = "true" ]; then
8268
if command -v systemctl >/dev/null; then
8369
systemctl disable elasticsearch.service > /dev/null 2>&1 || true
8470
fi
85-
86-
if command -v chkconfig >/dev/null; then
87-
chkconfig --del elasticsearch 2> /dev/null || true
88-
fi
89-
90-
if command -v update-rc.d >/dev/null; then
91-
update-rc.d elasticsearch remove >/dev/null || true
92-
fi
9371
fi
9472

9573
${scripts.footer}

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
@@ -20,19 +20,13 @@ non-standard-dir-perm etc/elasticsearch/jvm.options.d/ 2750 != 0755
2020
non-standard-file-perm etc/elasticsearch/*
2121
non-standard-dir-perm var/lib/elasticsearch/ 2750 != 0755
2222
non-standard-dir-perm var/log/elasticsearch/ 2750 != 0755
23-
executable-is-not-world-readable etc/init.d/elasticsearch 0750
24-
non-standard-file-permissions-for-etc-init.d-script etc/init.d/elasticsearch 0750 != 0755
2523

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

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

3731
# bundled JDK
3832
embedded-library

0 commit comments

Comments
 (0)