From: Eric Bollengier Date: Wed, 20 Apr 2011 19:03:38 +0000 (+0200) Subject: Allow custom variables and checks from debian/ubuntu startup scripts X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b7433858038911644adf05b9f036ec75eab7ad88;p=bacula%2Fbacula Allow custom variables and checks from debian/ubuntu startup scripts --- diff --git a/bacula/platforms/debian/bacula-dir.in b/bacula/platforms/debian/bacula-dir.in index 1a1d7cb34f..73253dce8e 100644 --- a/bacula/platforms/debian/bacula-dir.in +++ b/bacula/platforms/debian/bacula-dir.in @@ -35,6 +35,10 @@ if [ -n "`getent services ${NAME}`" ]; then BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'` fi +if [ -f /etc/default/$NAME ]; then + . /etc/default/$NAME +fi + PIDFILE=@piddir@/${NAME}.${BPORT}.pid if [ "x${BUSER}" != "x" ]; then diff --git a/bacula/platforms/debian/bacula-fd.in b/bacula/platforms/debian/bacula-fd.in index 93cf0f81c6..181625ce7d 100644 --- a/bacula/platforms/debian/bacula-fd.in +++ b/bacula/platforms/debian/bacula-fd.in @@ -35,6 +35,10 @@ if [ -n "`getent services ${NAME}`" ]; then BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'` fi +if [ -f /etc/default/$NAME ]; then + . /etc/default/$NAME +fi + PIDFILE=@piddir@/${NAME}.${BPORT}.pid if [ "x${BUSER}" != "x" ]; then diff --git a/bacula/platforms/debian/bacula-sd.in b/bacula/platforms/debian/bacula-sd.in index fd5b7e809c..1753304755 100644 --- a/bacula/platforms/debian/bacula-sd.in +++ b/bacula/platforms/debian/bacula-sd.in @@ -35,6 +35,10 @@ if [ -n "`getent services ${NAME}`" ]; then BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'` fi +if [ -f /etc/default/$NAME ]; then + . /etc/default/$NAME +fi + PIDFILE=@piddir@/${NAME}.${BPORT}.pid if [ "x${BUSER}" != "x" ]; then diff --git a/bacula/platforms/ubuntu/bacula-dir.in b/bacula/platforms/ubuntu/bacula-dir.in index 5b460a2e97..c7d99642ca 100644 --- a/bacula/platforms/ubuntu/bacula-dir.in +++ b/bacula/platforms/ubuntu/bacula-dir.in @@ -42,6 +42,10 @@ if [ -n "`getent services ${NAME}`" ]; then BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'` fi +if [ -f /etc/default/$NAME ]; then + . /etc/default/$NAME +fi + mkdir -p @piddir@ PIDFILE=@piddir@/${NAME}.${BPORT}.pid diff --git a/bacula/platforms/ubuntu/bacula-fd.in b/bacula/platforms/ubuntu/bacula-fd.in index 49510f3ff6..9fb7aff06b 100644 --- a/bacula/platforms/ubuntu/bacula-fd.in +++ b/bacula/platforms/ubuntu/bacula-fd.in @@ -42,6 +42,10 @@ if [ -n "`getent services ${NAME}`" ]; then BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'` fi +if [ -f /etc/default/$NAME ]; then + . /etc/default/$NAME +fi + mkdir -p @piddir@ PIDFILE=@piddir@/${NAME}.${BPORT}.pid diff --git a/bacula/platforms/ubuntu/bacula-sd.in b/bacula/platforms/ubuntu/bacula-sd.in index 46b48d7aa0..e778ea9613 100644 --- a/bacula/platforms/ubuntu/bacula-sd.in +++ b/bacula/platforms/ubuntu/bacula-sd.in @@ -42,6 +42,10 @@ if [ -n "`getent services ${NAME}`" ]; then BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'` fi +if [ -f /etc/default/$NAME ]; then + . /etc/default/$NAME +fi + mkdir -p @piddir@ PIDFILE=@piddir@/${NAME}.${BPORT}.pid