[pkg-bacula-commits] [SCM] Bacula, a network backup, recovery and verification program branch, master, updated. debian/5.0.3-1-43-geac3ea4

Alexander Golovko alexandro at ankalagon.ru
Sat May 19 11:53:14 UTC 2012


The following commit has been merged in the master branch:
commit eac3ea4fb58824a30af801acff5f26069509057c
Author: Alexander Golovko <alexandro at ankalagon.ru>
Date:   Sat May 19 15:52:46 2012 +0400

    Fix bacula-director-(pgsql|sqlite3) init script
    
    When merging commit for migate debian/rules to debhelper, bacula-director
    init script was moved from bacula-director-common package into
    bacula-director-<dbtype> packages.
    
    Unfortunnely, for pgsql and sqlite3 file differ from original.
    Fixing it.

diff --git a/debian/bacula-director-pgsql.bacula-director.init b/debian/bacula-director-pgsql.bacula-director.init
index 1e12cb9..021fd87 100644
--- a/debian/bacula-director-pgsql.bacula-director.init
+++ b/debian/bacula-director-pgsql.bacula-director.init
@@ -7,7 +7,6 @@
 # Should-Stop:       bacula-fd
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
-# Short-Description: Start Bacula Director at boot time
 ### END INIT INFO
 # bacula-director     SysV init script for Bacula-Director.
 #
@@ -20,6 +19,7 @@ DAEMON=/usr/sbin/bacula-dir
 NAME="bacula-dir"
 PORT=9101
 DESC="Bacula Director"
+ARGS="-c /etc/bacula/bacula-dir.conf -u bacula -g bacula"
 
 test -f $DAEMON || exit 0
 
@@ -29,13 +29,12 @@ if [ -n "`getent services bacula-dir`" ]; then
         PORT=`getent services bacula-dir | awk '{ gsub("/tcp","",$2); print $2; }'`
 fi
  
-. /lib/lsb/init-functions
-if [ -r /etc/default/bacula-dir ]; then
-	. /etc/default/bacula-dir
-fi
 
 PIDFILE=/var/run/bacula/$NAME.$PORT.pid
-CONFIG="${CONFIG:-/etc/bacula/bacula-fd.conf}"
+
+. /lib/lsb/init-functions
+. /usr/share/bacula-common/common-functions
+create_var_run_dir
 
 get_pid()
 {
@@ -57,7 +56,7 @@ kill_pid()
 do_start()
 {
 	start-stop-daemon --start --quiet --pidfile $PIDFILE \
-	--oknodo --exec $DAEMON -- -c $CONFIG $ARGS
+	--oknodo --exec $DAEMON -- $ARGS
 }
 
 # do_stop()
@@ -65,7 +64,7 @@ do_stop()
 {
 	get_pid $PIDFILE ;
 	start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
-		--exec $DAEMON -- -c $CONFIG $ARGS
+		--exec $DAEMON
  	# make sure daemon is stopped/killed
 	if [ -n "$pid" ]; then
 	    if check_pid $pid ; then
@@ -92,12 +91,7 @@ case "$1" in
                 log_failure_msg "Not starting $DESC: disabled via /etc/bacula/do_not_run"
 		exit 0
 	fi
-
-	if [ "$ENABLED" = "no" ]; then
-                log_failure_msg "Not starting $DESC: disabled via /etc/default/bacula-dir"
-		exit 0
-	fi
-
+	create_var_run_dir
 	log_daemon_msg "Starting $DESC..."
         if do_start ; then
                 log_end_msg 0
diff --git a/debian/bacula-director-sqlite3.bacula-director.init b/debian/bacula-director-sqlite3.bacula-director.init
index 1e12cb9..021fd87 100644
--- a/debian/bacula-director-sqlite3.bacula-director.init
+++ b/debian/bacula-director-sqlite3.bacula-director.init
@@ -7,7 +7,6 @@
 # Should-Stop:       bacula-fd
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
-# Short-Description: Start Bacula Director at boot time
 ### END INIT INFO
 # bacula-director     SysV init script for Bacula-Director.
 #
@@ -20,6 +19,7 @@ DAEMON=/usr/sbin/bacula-dir
 NAME="bacula-dir"
 PORT=9101
 DESC="Bacula Director"
+ARGS="-c /etc/bacula/bacula-dir.conf -u bacula -g bacula"
 
 test -f $DAEMON || exit 0
 
@@ -29,13 +29,12 @@ if [ -n "`getent services bacula-dir`" ]; then
         PORT=`getent services bacula-dir | awk '{ gsub("/tcp","",$2); print $2; }'`
 fi
  
-. /lib/lsb/init-functions
-if [ -r /etc/default/bacula-dir ]; then
-	. /etc/default/bacula-dir
-fi
 
 PIDFILE=/var/run/bacula/$NAME.$PORT.pid
-CONFIG="${CONFIG:-/etc/bacula/bacula-fd.conf}"
+
+. /lib/lsb/init-functions
+. /usr/share/bacula-common/common-functions
+create_var_run_dir
 
 get_pid()
 {
@@ -57,7 +56,7 @@ kill_pid()
 do_start()
 {
 	start-stop-daemon --start --quiet --pidfile $PIDFILE \
-	--oknodo --exec $DAEMON -- -c $CONFIG $ARGS
+	--oknodo --exec $DAEMON -- $ARGS
 }
 
 # do_stop()
@@ -65,7 +64,7 @@ do_stop()
 {
 	get_pid $PIDFILE ;
 	start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
-		--exec $DAEMON -- -c $CONFIG $ARGS
+		--exec $DAEMON
  	# make sure daemon is stopped/killed
 	if [ -n "$pid" ]; then
 	    if check_pid $pid ; then
@@ -92,12 +91,7 @@ case "$1" in
                 log_failure_msg "Not starting $DESC: disabled via /etc/bacula/do_not_run"
 		exit 0
 	fi
-
-	if [ "$ENABLED" = "no" ]; then
-                log_failure_msg "Not starting $DESC: disabled via /etc/default/bacula-dir"
-		exit 0
-	fi
-
+	create_var_run_dir
 	log_daemon_msg "Starting $DESC..."
         if do_start ; then
                 log_end_msg 0

-- 
Bacula, a network backup, recovery and verification program



More information about the pkg-bacula-commits mailing list