X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fscripts%2Fbacula.in;h=0ca89a1d68e46198455749d07786c3eddd4eade8;hb=9235855757736c38f11bf81f9f0fc6cc59702f5b;hp=2952141c860be53b4c50094ae483b90bc2a50f43;hpb=465e790d369482c53486ddb9f00cb3a7fd1b30f3;p=bacula%2Fbacula diff --git a/bacula/scripts/bacula.in b/bacula/scripts/bacula.in index 2952141c86..0ca89a1d68 100755 --- a/bacula/scripts/bacula.in +++ b/bacula/scripts/bacula.in @@ -11,14 +11,22 @@ PSCMD="@PSCMD@" -BACBIN=@sbindir@ -BACCFG=@sysconfdir@ +# All these are not *really* needed but it makes it +# easier to "steal" this code for the development +# environment where they are different. +# +BACFDBIN=@sbindir@ +BACFDCFG=@sysconfdir@ +BACSDBIN=@sbindir@ +BACSDCFG=@sysconfdir@ +BACDIRBIN=@sbindir@ +BACDIRCFG=@sysconfdir@ PIDDIR=@piddir@ SUBSYSDIR=@subsysdir@ -DIR_PORT=9101 -FD_PORT=9102 -SD_PORT=9103 +DIR_PORT=@dir_port@ +FD_PORT=@fd_port@ +SD_PORT=@sd_port@ DIR_USER=@dir_user@ DIR_GROUP=@dir_group@ @@ -181,64 +189,65 @@ failure() { case "$1" in start) - [ -x ${BACBIN}/bacula-sd ] && { - echo "Starting the Storage daemon" - OPTIONS='' - if [ "${SD_USER}" != '' ]; then - OPTIONS="${OPTIONS} -u ${SD_USER}" - fi - - if [ "${SD_GROUP}" != '' ]; then - OPTIONS="${OPTIONS} -g ${SD_GROUP}" - fi - - ${BACBIN}/bacula-sd $2 ${OPTIONS} -v -c ${BACCFG}/bacula-sd.conf + [ -x ${BACSDBIN}/bacula-sd ] && { + echo "Starting the Storage daemon" + OPTIONS='' + if [ "${SD_USER}" != '' ]; then + OPTIONS="${OPTIONS} -u ${SD_USER}" + fi + + if [ "${SD_GROUP}" != '' ]; then + OPTIONS="${OPTIONS} -g ${SD_GROUP}" + fi + + ${BACSDBIN}/bacula-sd $2 ${OPTIONS} -v -c ${BACSDCFG}/bacula-sd.conf } - [ -x ${BACBIN}/bacula-fd ] && { - echo "Starting the File daemon" - OPTIONS='' - if [ "${FD_USER}" != '' ]; then - OPTIONS="${OPTIONS} -u ${FD_USER}" - fi + [ -x ${BACFDBIN}/bacula-fd ] && { + echo "Starting the File daemon" + OPTIONS='' + if [ "${FD_USER}" != '' ]; then + OPTIONS="${OPTIONS} -u ${FD_USER}" + fi - if [ "${FD_GROUP}" != '' ]; then - OPTIONS="${OPTIONS} -g ${FD_GROUP}" - fi + if [ "${FD_GROUP}" != '' ]; then + OPTIONS="${OPTIONS} -g ${FD_GROUP}" + fi - ${BACBIN}/bacula-fd $2 ${OPTIONS} -v -c ${BACCFG}/bacula-fd.conf + ${BACFDBIN}/bacula-fd $2 ${OPTIONS} -v -c ${BACFDCFG}/bacula-fd.conf } - [ -x ${BACBIN}/bacula-dir ] && { - sleep 2 - echo "Starting the Director daemon" - OPTIONS='' - if [ "${DIR_USER}" != '' ]; then - OPTIONS="${OPTIONS} -u ${DIR_USER}" - fi + [ -x ${BACDIRBIN}/bacula-dir ] && { + sleep 2 + echo "Starting the Director daemon" + OPTIONS='' + if [ "${DIR_USER}" != '' ]; then + OPTIONS="${OPTIONS} -u ${DIR_USER}" + fi - if [ "${DIR_GROUP}" != '' ]; then - OPTIONS="${OPTIONS} -g ${DIR_GROUP}" - fi + if [ "${DIR_GROUP}" != '' ]; then + OPTIONS="${OPTIONS} -g ${DIR_GROUP}" + fi - ${BACBIN}/bacula-dir $2 ${OPTIONS} -v -c ${BACCFG}/bacula-dir.conf + ${BACDIRBIN}/bacula-dir $2 ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf } ;; stop) - [ -x ${BACBIN}/bacula-sd ] && { - echo "Stopping the Storage daemon" - killproc ${BACBIN}/bacula-sd ${SD_PORT} + # Stop the FD first so that SD will fail jobs and update catalog + [ -x ${BACFDBIN}/bacula-fd ] && { + echo "Stopping the File daemon" + killproc ${BACFDBIN}/bacula-fd ${FD_PORT} } - [ -x ${BACBIN}/bacula-fd ] && { - echo "Stopping the File daemon" - killproc ${BACBIN}/bacula-fd ${FD_PORT} + [ -x ${BACSDBIN}/bacula-sd ] && { + echo "Stopping the Storage daemon" + killproc ${BACSDBIN}/bacula-sd ${SD_PORT} } - [ -x ${BACBIN}/bacula-dir ] && { - echo "Stopping the Director daemon" - killproc ${BACBIN}/bacula-dir ${DIR_PORT} + [ -x ${BACDIRBIN}/bacula-dir ] && { + echo "Stopping the Director daemon" + killproc ${BACDIRBIN}/bacula-dir ${DIR_PORT} } echo ;; @@ -250,9 +259,9 @@ case "$1" in ;; status) - [ -x ${BACBIN}/bacula-sd ] && status ${BACBIN}/bacula-sd ${SD_PORT} - [ -x ${BACBIN}/bacula-fd ] && status ${BACBIN}/bacula-fd ${FD_PORT} - [ -x ${BACBIN}/bacula-dir ] && status ${BACBIN}/bacula-dir ${DIR_PORT} + [ -x ${BACSDBIN}/bacula-sd ] && status ${BACSDBIN}/bacula-sd ${SD_PORT} + [ -x ${BACFDBIN}/bacula-fd ] && status ${BACFDBIN}/bacula-fd ${FD_PORT} + [ -x ${BACDIRBIN}/bacula-dir ] && status ${BACDIRBIN}/bacula-dir ${DIR_PORT} ;; *)