From 48438ffc61bce2396fa2eac2f88fa66a6e6a69cd Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Mon, 21 May 2012 11:19:59 -0500 Subject: [PATCH] warn if deb sysctl vm.max_map_count setting fails for OpenVZ Patch by paul cannon, reviewed by brandonwilliams for CASSANDRA-3636 --- debian/cassandra.postinst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/cassandra.postinst b/debian/cassandra.postinst index 86adecb270..959145934c 100644 --- a/debian/cassandra.postinst +++ b/debian/cassandra.postinst @@ -38,7 +38,15 @@ case "$1" in chown -R cassandra: /var/lib/cassandra chown -R cassandra: /var/log/cassandra fi - sysctl -p /etc/sysctl.d/cassandra.conf + if ! sysctl -p /etc/sysctl.d/cassandra.conf; then + echo >&2 + echo "Warning: unable to set vm.max_map_count; is this an OpenVZ" >&2 + echo "instance? If so, it is highly recommended that you set" >&2 + echo "vm.max_map_count to 1048575 in the host." >&2 + echo >&2 + echo "Deleting the local sysctl.d/cassandra.conf." >&2 + rm -v /etc/sysctl.d/cassandra.conf + fi ;; abort-upgrade|abort-remove|abort-deconfigure)