From 0e71274fbc4f05304d3a108788d185ec98bb2ddf Mon Sep 17 00:00:00 2001 From: xiaodongwang Date: Wed, 4 Feb 2015 17:42:21 -0800 Subject: [PATCH] check dnsmasq exists before kill dnsmasq service Change-Id: If9164019d29d4eda230262d27ef34af1dc073fc1 --- install/cobbler.sh | 16 +++++++++------- install/dependency.sh | 4 +++- install/install_func.sh | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/install/cobbler.sh b/install/cobbler.sh index d3c13618..459321cd 100755 --- a/install/cobbler.sh +++ b/install/cobbler.sh @@ -159,15 +159,17 @@ echo "disable selinux temporarily" echo 0 > /selinux/enforce # make log dir -mkdir -p /var/log/cobbler -mkdir -p /var/log/cobbler/tasks -mkdir -p /var/log/cobbler/anamon -chmod -R 777 /var/log/cobbler +sudo mkdir -p /var/log/cobbler +sudo mkdir -p /var/log/cobbler/tasks +sudo mkdir -p /var/log/cobbler/anamon +sudo chmod -R 777 /var/log/cobbler # kill dnsmasq service -chkconfig dnsmasq off -service dnsmasq stop -killall -9 dnsmasq +if `sudo chkconfig --list dnsmasq`; then + sudo chkconfig dnsmasq off + sudo service dnsmasq stop +fi +sudo killall -9 dnsmasq sudo service httpd restart sudo service cobblerd restart diff --git a/install/dependency.sh b/install/dependency.sh index 10018601..2d114147 100755 --- a/install/dependency.sh +++ b/install/dependency.sh @@ -52,4 +52,6 @@ sudo chkconfig redis on sudo chkconfig mysqld on sudo chkconfig iptables off sudo chkconfig ip6tables off -sudo chkconfig dnsmasq off +if `sudo chkconfig --list dnsmasq`; then + sudo chkconfig dnsmasq off +fi diff --git a/install/install_func.sh b/install/install_func.sh index e2f94721..1ec1aeee 100755 --- a/install/install_func.sh +++ b/install/install_func.sh @@ -205,7 +205,7 @@ download() fi fi if [[ "$url" =~ (http|https|ftp):// ]]; then - echo "downloading $url to /tmp/${package}" + echo "download $url to /tmp/${package}" if [[ -f /tmp/${package} || -L /tmp/${package} ]]; then curl -f -L -z /tmp/${package} -o /tmp/${package}.tmp $url else