diff --git a/bacula-dir.init b/bacula-dir.init index 02376ac..a4be040 100644 --- a/bacula-dir.init +++ b/bacula-dir.init @@ -33,50 +33,11 @@ if [ "$DIR_GROUP" != '' ]; then OPTS="$OPTS -g $DIR_GROUP" fi -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 is 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 is not running" - echo_failure - echo - exit 1 - fi - ;; - *) - echo -n "Error: Unknown database backend" - echo_failure - echo - exit 1 - ;; - esac -} - start() { [ "$EUID" != "0" ] && exit 4 echo -n "Starting $prog: " bacula-checkconf $CONFIG -# Removed for now, as the db might not be on localhost -# checkdatabase daemon $prog $OPTS RETVAL=$? echo diff --git a/bacula-sd.init b/bacula-sd.init index 6fb5e8d..46aec10 100644 --- a/bacula-sd.init +++ b/bacula-sd.init @@ -32,50 +32,11 @@ if [ "$SD_GROUP" != '' ]; then OPTS="$OPTS -g $SD_GROUP" 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 is 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 is not running" - echo_failure - echo - exit 1 - fi - ;; - *) - echo -n "Error: Unknown database backend" - echo_failure - echo - exit 1 - ;; - esac -} - start() { [ "$EUID" != "0" ] && exit 4 echo -n "Starting $prog: " bacula-checkconf $CONFIG -# Disabled, the DB does not necessarily run on the same machine -# checkdatabase daemon $prog $OPTS RETVAL=$? echo