]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/scripts/bacula-ctl-dir.in
Make mtx-changer errors clearer
[bacula/bacula] / bacula / scripts / bacula-ctl-dir.in
index 693e59aba9468fd6afe4cfad04f51ca04d2de1ee..0eb28d9a72d1ebe126f540bbc75f7809aa40ded5 100644 (file)
@@ -128,7 +128,8 @@ pidofproc() {
    fi
 
    # Finally try to extract it from ps
-   ${PSCMD} | grep $1 | ${AWK} '{ print $1 }' | tr '\n' ' '
+   pid=`${PSCMD} | grep $1 | ${AWK} '{ print $1 }' | tr '\n' ' '`
+   echo $pid
    return 0
 }
 
@@ -197,7 +198,6 @@ fi
 case "$1" in
    start)
       [ -x ${BACDIRBIN}/bacula-dir ] && { 
-         sleep 2
          echo "Starting the $Bacula Director daemon"
         OPTIONS=''
         if [ "${DIR_USER}" != '' ]; then
@@ -209,10 +209,11 @@ case "$1" in
         fi
 
         if [ "x${VALGRIND}" = "x1" ]; then
-           valgrind --leak-check=full ${BACDIRBIN}/bacula-dir $2 ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf
+           valgrind --leak-check=full ${BACDIRBIN}/bacula-dir $2 $3 ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf
         else
-           ${BACDIRBIN}/bacula-dir $2 ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf
+           ${BACDIRBIN}/bacula-dir $2 $3 ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf
         fi
+        sleep 1
       }
       ;;