From 86ae0a38a95a8efbc35b022187a0256b2eeb04fa Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Thu, 24 Sep 2015 12:34:42 +0000 Subject: [PATCH] dist: check hostname is resolvable Warning for #6 Signed-off-by: Takuya ASADA [ penberg: edit warning text ] Signed-off-by: Pekka Enberg --- dist/redhat/scylla-jmx.spec.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dist/redhat/scylla-jmx.spec.in b/dist/redhat/scylla-jmx.spec.in index 9bbf899..ce69d87 100644 --- a/dist/redhat/scylla-jmx.spec.in +++ b/dist/redhat/scylla-jmx.spec.in @@ -38,6 +38,15 @@ install -m755 dist/redhat/scripts/* $RPM_BUILD_ROOT%{_prefix}/lib/scylla/jmx %pre /usr/sbin/groupadd scylla 2> /dev/null || : /usr/sbin/useradd -g scylla -s /sbin/nologin -r -d ${_sharedstatedir}/scylla scylla 2> /dev/null || : +ping -c1 `hostname` > /dev/null 2>&1 +if [ $? -ne 0 ]; then +echo +echo "**************************************************************" +echo "* WARNING: You need to add hostname on /etc/hosts, otherwise *" +echo "* scylla-jmx will not able to start up. *" +echo "**************************************************************" +echo +fi %post %systemd_post scylla-jmx.service