Skip to content

Avoid failing install if system-sysctl is masked #25657

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 1 commit into from
Jul 11, 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
2 changes: 1 addition & 1 deletion distribution/src/main/packaging/scripts/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ esac

# to pick up /usr/lib/sysctl.d/elasticsearch.conf
if command -v systemctl > /dev/null; then
systemctl restart systemd-sysctl.service
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
Expand Up @@ -186,3 +186,12 @@ setup() {

systemctl stop elasticsearch.service
}

@test "[SYSTEMD] masking systemd-sysctl" {
clean_before_test

systemctl mask systemd-sysctl.service
install_package

systemctl unmask systemd-sysctl.service
}
5 changes: 4 additions & 1 deletion qa/vagrant/src/test/resources/packaging/utils/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,16 @@ clean_before_test() {
userdel elasticsearch > /dev/null 2>&1 || true
groupdel elasticsearch > /dev/null 2>&1 || true


# Removes all files
for d in "${ELASTICSEARCH_TEST_FILES[@]}"; do
if [ -e "$d" ]; then
rm -rf "$d"
fi
done

if is_systemd; then
systemctl unmask systemd-sysctl.service
fi
}

purge_elasticsearch() {
Expand Down