Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SysV init support #51716

Merged
merged 18 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions distribution/packages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,6 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
fileMode 0755
}

// ========= sysV init =========
configurationFile '/etc/init.d/elasticsearch'
into('/etc/init.d') {
fileMode 0750
fileType CONFIG | NOREPLACE
from "${packagingFiles}/init.d/elasticsearch"
}

// ========= empty dirs =========
// NOTE: these are created under packagingFiles as empty, but the permissions are set here
Closure copyEmptyDir = { path, u, g, mode ->
Expand Down
30 changes: 0 additions & 30 deletions distribution/packages/src/common/env/elasticsearch
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,3 @@ ES_PATH_CONF=${path.conf}

# Configure restart on package upgrade (true, every other setting will lead to not restarting)
#RESTART_ON_UPGRADE=true

################################
# Elasticsearch service
################################

# SysV init.d
#
# The number of seconds to wait before checking if Elasticsearch started successfully as a daemon process
ES_STARTUP_SLEEP_TIME=5

################################
# System properties
################################

# Specifies the maximum file descriptor number that can be opened by this process
# When using Systemd, this setting is ignored and the LimitNOFILE defined in
# /usr/lib/systemd/system/elasticsearch.service takes precedence
#MAX_OPEN_FILES=65535

# The maximum number of bytes of memory that may be locked into RAM
# Set to "unlimited" if you use the 'bootstrap.memory_lock: true' option
# in elasticsearch.yml.
# When using systemd, LimitMEMLOCK must be set in a unit file such as
# /etc/systemd/system/elasticsearch.service.d/override.conf.
#MAX_LOCKED_MEMORY=unlimited

# Maximum number of VMA (Virtual Memory Areas) a process can own
# When using Systemd, this setting is ignored and the 'vm.max_map_count'
# property is set at boot time in /usr/lib/sysctl.d/elasticsearch.conf
#MAX_MAP_COUNT=262144
27 changes: 0 additions & 27 deletions distribution/packages/src/common/scripts/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -62,40 +62,13 @@ if [ "x$IS_UPGRADE" != "xtrue" ]; then
echo " sudo systemctl enable elasticsearch.service"
echo "### You can start elasticsearch service by executing"
echo " sudo systemctl start elasticsearch.service"

elif command -v chkconfig >/dev/null; then
echo "### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using chkconfig"
echo " sudo chkconfig --add elasticsearch"
echo "### You can start elasticsearch service by executing"
echo " sudo service elasticsearch start"

elif command -v update-rc.d >/dev/null; then
echo "### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using chkconfig"
echo " sudo update-rc.d elasticsearch defaults 95 10"
echo "### You can start elasticsearch service by executing"
echo " sudo /etc/init.d/elasticsearch start"
fi
elif [ "$RESTART_ON_UPGRADE" = "true" ]; then

echo -n "Restarting elasticsearch service..."
if command -v systemctl >/dev/null; then
systemctl daemon-reload
systemctl restart elasticsearch.service || true

elif [ -x /etc/init.d/elasticsearch ]; then
if command -v invoke-rc.d >/dev/null; then
invoke-rc.d elasticsearch stop || true
invoke-rc.d elasticsearch start || true
else
/etc/init.d/elasticsearch restart || true
fi

# older suse linux distributions do not ship with systemd
# but do not have an /etc/init.d/ directory
# this tries to start the elasticsearch service on these
# as well without failing this script
elif [ -x /etc/rc.d/init.d/elasticsearch ] ; then
/etc/rc.d/init.d/elasticsearch restart || true
fi
echo " OK"
fi
Expand Down
24 changes: 1 addition & 23 deletions distribution/packages/src/common/scripts/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,7 @@ esac
if [ "$STOP_REQUIRED" = "true" ]; then
echo -n "Stopping elasticsearch service..."
if command -v systemctl >/dev/null; then
systemctl --no-reload stop elasticsearch.service

elif [ -x /etc/init.d/elasticsearch ]; then
if command -v invoke-rc.d >/dev/null; then
invoke-rc.d elasticsearch stop
else
/etc/init.d/elasticsearch stop
fi

# older suse linux distributions do not ship with systemd
# but do not have an /etc/init.d/ directory
# this tries to start the elasticsearch service on these
# as well without failing this script
elif [ -x /etc/rc.d/init.d/elasticsearch ] ; then
/etc/rc.d/init.d/elasticsearch stop
systemctl --no-reload stop elasticsearch.service || true
fi
echo " OK"
fi
Expand All @@ -82,14 +68,6 @@ if [ "$REMOVE_SERVICE" = "true" ]; then
if command -v systemctl >/dev/null; then
systemctl disable elasticsearch.service > /dev/null 2>&1 || true
fi

if command -v chkconfig >/dev/null; then
chkconfig --del elasticsearch 2> /dev/null || true
fi

if command -v update-rc.d >/dev/null; then
update-rc.d elasticsearch remove >/dev/null || true
fi
fi

${scripts.footer}
171 changes: 0 additions & 171 deletions distribution/packages/src/deb/init.d/elasticsearch

This file was deleted.

8 changes: 1 addition & 7 deletions distribution/packages/src/deb/lintian/elasticsearch
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,13 @@ non-standard-dir-perm etc/elasticsearch/jvm.options.d/ 2750 != 0755
non-standard-file-perm etc/elasticsearch/*
non-standard-dir-perm var/lib/elasticsearch/ 2750 != 0755
non-standard-dir-perm var/log/elasticsearch/ 2750 != 0755
executable-is-not-world-readable etc/init.d/elasticsearch 0750
non-standard-file-permissions-for-etc-init.d-script etc/init.d/elasticsearch 0750 != 0755

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

# we do not automatically enable the service in init.d or systemd
script-in-etc-init.d-not-registered-via-update-rc.d etc/init.d/elasticsearch

# the package scripts handle init.d/systemd directly and don't need to use deb helpers
# the package scripts handle systemd directly and don't need to use deb helpers
maintainer-script-calls-systemctl
prerm-calls-updaterc.d elasticsearch

# bundled JDK
embedded-library
Expand Down
Loading