[bacula/el5] SysV init scripts cleanup

Simone Caronni slaanesh at fedoraproject.org
Wed Jul 18 13:04:18 UTC 2012


commit 78c2d83d911c8df10b0546e59dbff4aacade8a12
Author: Simone Caronni <negativo17 at gmail.com>
Date:   Wed Jul 18 14:26:25 2012 +0200

    SysV init scripts cleanup

 bacula-dir.init |   43 +------------------------------------------
 bacula-fd.init  |    4 +---
 bacula-sd.init  |   44 +-------------------------------------------
 3 files changed, 3 insertions(+), 88 deletions(-)
---
diff --git a/bacula-dir.init b/bacula-dir.init
index c77c521..ac97daa 100644
--- a/bacula-dir.init
+++ b/bacula-dir.init
@@ -38,48 +38,9 @@ checkconf() {
 }
 
 
-checkdatabase() {
-	# First, get the currently selected database backend from the
-	# alternatives system.
-	DB=$(LANG=C alternatives --display bacula-dir | grep 'link currently points to' | awk -F. '{ print $2 }')
-	case "$DB" in
-		sqlite)
-			# No check needed to see if the Database is running
-			;;
-		mysql)
-			# Check if mysqld is running
-			service mysqld status > /dev/null 2>&1
-			if [ $? -ne 0 ]; then
-				echo -n "Error: MySQL not running"
-				echo_failure
-				echo
-				exit 1
-			fi
-			;;
-		postgresql)
-			# Check if postgresql is running
-			service postgresql status > /dev/null 2>&1
-			if [ $? -ne 0 ]; then
-				echo -n "Error: PostgreSQL not running"
-				echo_failure
-				echo
-				exit 1
-			fi
-			;;
-		*)
-			echo -n "Error: Unknown database backend"
-			echo_failure
-			echo
-			exit 1
-			;;
-	esac
-}
-
 start() {
 	echo -n "Starting $prog: "
 	checkconf
-#	Removed for now, as the db might not be on localhost
-#	checkdatabase
 	daemon $prog $OPTS
 	RETVAL=$?
 	echo
@@ -111,8 +72,6 @@ case "$1" in
 		start
 		RETVAL=$?
 		;;
-    reload)
-		;;
     condrestart)
 		if [ -f /var/lock/subsys/$prog ]; then
 			stop
@@ -121,7 +80,7 @@ case "$1" in
 		fi
 		;;
     *)
-	echo "Usage: $prog {start|stop|status|reload|restart}"
+	echo "Usage: $prog {start|stop|status|restart|condrestart}"
 	exit 1
 	;;
 esac
diff --git a/bacula-fd.init b/bacula-fd.init
index 3374e6f..d767fe2 100644
--- a/bacula-fd.init
+++ b/bacula-fd.init
@@ -72,8 +72,6 @@ case "$1" in
 		start
 		RETVAL=$?
 		;;
-    reload)
-		;;
     condrestart)
 		if [ -f /var/lock/subsys/$prog ]; then
 			stop
@@ -82,7 +80,7 @@ case "$1" in
 		fi
 		;;
     *)
-	echo "Usage: $prog {start|stop|status|reload|restart}"
+	echo "Usage: $prog {start|stop|status|restart|condrestart}"
 	exit 1
 	;;
 esac
diff --git a/bacula-sd.init b/bacula-sd.init
index 14e3255..bd5244d 100644
--- a/bacula-sd.init
+++ b/bacula-sd.init
@@ -36,49 +36,9 @@ checkconf() {
 	fi
 }
 
-
-checkdatabase() {
-	# First, get the currently selected database backend from the
-	# alternatives system.
-	DB=$(LANG=C alternatives --display bacula-sd | grep 'link currently points to' | awk -F. '{ print $2 }')
-	case "$DB" in
-		sqlite)
-			# No check needed to see if the Database is running
-			;;
-		mysql)
-			# Check if mysqld is running
-			service mysqld status > /dev/null 2>&1
-			if [ $? -ne 0 ]; then
-				echo -n "Error: MySQL not running"
-				echo_failure
-				echo
-				exit 1
-			fi
-			;;
-		postgresql)
-			# Check if postgresql is running
-			service postgresql status > /dev/null 2>&1
-			if [ $? -ne 0 ]; then
-				echo -n "Error: PostgreSQL not running"
-				echo_failure
-				echo
-				exit 1
-			fi
-			;;
-		*)
-			echo -n "Error: Unknown database backend"
-			echo_failure
-			echo
-			exit 1
-			;;
-	esac
-}
-
 start() {
 	echo -n "Starting $prog: "
 	checkconf
-# Disabled, the DB does not necessarily run on the same machine
-#	checkdatabase
 	daemon $prog $OPTS
 	RETVAL=$?
 	echo
@@ -110,8 +70,6 @@ case "$1" in
 		start
 		RETVAL=$?
 		;;
-    reload)
-		;;
     condrestart)
 		if [ -f /var/lock/subsys/$prog ]; then
 			stop
@@ -120,7 +78,7 @@ case "$1" in
 		fi
 		;;
     *)
-	echo "Usage: $prog {start|stop|status|reload|restart}"
+	echo "Usage: $prog {start|stop|status|restart|condrestart}"
 	exit 1
 	;;
 esac


More information about the scm-commits mailing list