summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/monitor/files
diff options
context:
space:
mode:
authorbaigk <baiguoku@huawei.com>2015-09-12 13:55:40 +0800
committerbaigk <baiguoku@huawei.com>2015-09-12 16:28:25 +0800
commit6fec88cd73e388a14dcfdad812781667e5f9a668 (patch)
treefbe8e182526c29a83e1f9f5d97d0ac265191433e /deploy/adapters/ansible/roles/monitor/files
parent6ec9d66787b01e710de5514f377830a94e32a4d2 (diff)
bug fix:support centos 7.1 deployment
JIRA: COMPASS-46 Change-Id: I4003c843b34509d44b45d0235fdf66d9114ff8d5 Signed-off-by: baigk <baiguoku@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/monitor/files')
-rw-r--r--deploy/adapters/ansible/roles/monitor/files/check_Debian_service.sh7
-rw-r--r--deploy/adapters/ansible/roles/monitor/files/check_RedHat_service.sh8
2 files changed, 15 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/monitor/files/check_Debian_service.sh b/deploy/adapters/ansible/roles/monitor/files/check_Debian_service.sh
new file mode 100644
index 00000000..0138100c
--- /dev/null
+++ b/deploy/adapters/ansible/roles/monitor/files/check_Debian_service.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+services=`cat /opt/service | uniq`
+for service in $services; do
+ if [ `/sbin/initctl list|awk '/stop\/waiting/{print $1}'|uniq | grep $service` ]; then
+ /sbin/start $service
+ fi
+done
diff --git a/deploy/adapters/ansible/roles/monitor/files/check_RedHat_service.sh b/deploy/adapters/ansible/roles/monitor/files/check_RedHat_service.sh
new file mode 100644
index 00000000..0fd921f4
--- /dev/null
+++ b/deploy/adapters/ansible/roles/monitor/files/check_RedHat_service.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+services=`cat /opt/service | uniq`
+for service in $services; do
+ /usr/sbin/service $service status >/dev/null 2>&1
+ if [[ $? -ne 0 ]]; then
+ /usr/sbin/service $service start
+ fi
+done