Skip to content

Honor masking of systemd-sysctl.service #24234

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

Merged
merged 2 commits into from
Jun 6, 2017
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
13 changes: 2 additions & 11 deletions distribution/src/main/packaging/scripts/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,8 @@ case "$1" in
esac

# to pick up /usr/lib/sysctl.d/elasticsearch.conf
if [ "${ES_SKIP_SET_KERNEL_PARAMETERS:-false}" == "false" ]; then
if command -v /usr/lib/systemd/systemd-sysctl > /dev/null; then
/usr/lib/systemd/systemd-sysctl
elif command -v /lib/systemd/systemd-sysctl > /dev/null; then
/lib/systemd/systemd-sysctl
fi
elif [ "$ES_SKIP_SET_KERNEL_PARAMETERS" == "true" ]; then
echo "skipping setting kernel parameters"
else
echo "unrecognized value [$ES_SKIP_SET_KERNEL_PARAMETERS] for ES_SKIP_SET_KERNEL_PARAMETERS; must [false] (default) or [true]"
exit 1
if command -v systemctl > /dev/null; then
systemctl restart systemd-sysctl.service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this call is meant to fail silently, it should be:

systemctl restart systemd-sysctl.service || true

fi

if [ "x$IS_UPGRADE" != "xtrue" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NOTE: On systemd-based distributions, the installation scripts will attempt to set kernel parameters (e.g.,
`vm.max_map_count`); you can skip this by setting the environment variable `ES_SKIP_SET_KERNEL_PARAMETERS` to `true`.
`vm.max_map_count`); you can skip this by masking the systemd-sysctl.service unit.