[pkg-bacula-commits] [bacula] 04/04: Use /run and /run/lock instead of /var/run and /var/lock

Carsten Leonhardt leo at moszumanska.debian.org
Mon Aug 29 10:52:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

leo pushed a commit to branch migrate-files
in repository bacula.

commit 88289d242c272072c8a6125fa9d4327b80ee432b
Author: Carsten Leonhardt <leo at debian.org>
Date:   Mon Aug 29 12:44:46 2016 +0200

    Use /run and /run/lock instead of /var/run and /var/lock
---
 debian/TODO                            |  1 -
 debian/additions/common-functions.init | 17 +++++++++++++----
 debian/bacula-common.postrm            |  2 +-
 debian/bacula-director.init            |  4 ++--
 debian/bacula-fd.init                  |  4 ++--
 debian/bacula-sd.init                  |  4 ++--
 debian/changelog                       |  1 +
 debian/rules                           |  4 ++--
 8 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/debian/TODO b/debian/TODO
index 4363be7..6ef2865 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -25,7 +25,6 @@ Normal:
  * Check if bacula-director-pgsql suggesting postgresql-contrib is useful
  * Automatically detect the introduction of a new database version and
    warn or abort package build
- * Implement the /var/run -> /run migration
 
 Minor:
 
diff --git a/debian/additions/common-functions.init b/debian/additions/common-functions.init
index 631f94f..a726eb1 100644
--- a/debian/additions/common-functions.init
+++ b/debian/additions/common-functions.init
@@ -3,10 +3,19 @@
 # Common functions, used from init scripts
 #
 
-create_var_run_dir()
+create_run_dir()
 {
-	if [ ! -d /var/run/bacula/ ]; then
-		mkdir -p -m 0755 /var/run/bacula/
-		chown bacula:daemon /var/run/bacula/
+	if [ ! -d /run/bacula/ ]; then
+		mkdir -p -m 0755 /run/bacula/
+		chown bacula:daemon /run/bacula/
 	fi
 }
+
+# as a precaution, also define the function name from before the
+# /var/run -> /run migration
+# XXX to be removed in stretch+1 latest
+create_var_run_dir()
+{
+    log_warning_msg "Obsolete bacula init function create_var_run_dir called"
+    create_run_dir
+}
diff --git a/debian/bacula-common.postrm b/debian/bacula-common.postrm
index 379a016..ee6341f 100644
--- a/debian/bacula-common.postrm
+++ b/debian/bacula-common.postrm
@@ -5,7 +5,7 @@ set -e
 
 case "$1" in
 	purge)
-		rm -rf /var/run/bacula
+		rm -rf /run/bacula
 		rm -rf /etc/bacula
 		rm -rf /var/log/bacula
 		rm -rf /var/lib/bacula
diff --git a/debian/bacula-director.init b/debian/bacula-director.init
index 8ffc7ae..fac1755 100644
--- a/debian/bacula-director.init
+++ b/debian/bacula-director.init
@@ -38,7 +38,7 @@ if [ -n "`getent services bacula-dir`" ]; then
 fi
 
 
-PIDFILE=/var/run/bacula/$NAME.$PORT.pid
+PIDFILE=/run/bacula/$NAME.$PORT.pid
 
 . /lib/lsb/init-functions
 . /usr/share/bacula-common/common-functions.init
@@ -48,7 +48,7 @@ fi
 
 CONFIG="${CONFIG:-/etc/bacula/$NAME.conf}"
 
-create_var_run_dir
+create_run_dir
 
 get_pid()
 {
diff --git a/debian/bacula-fd.init b/debian/bacula-fd.init
index b5a570f..48f38af 100644
--- a/debian/bacula-fd.init
+++ b/debian/bacula-fd.init
@@ -44,10 +44,10 @@ fi
 
 CONFIG="${CONFIG:-/etc/bacula/$NAME.conf}"
 
-create_var_run_dir
+create_run_dir
 
 
-PIDFILE=/var/run/bacula/$NAME.$PORT.pid
+PIDFILE=/run/bacula/$NAME.$PORT.pid
 
 do_start()
 {
diff --git a/debian/bacula-sd.init b/debian/bacula-sd.init
index 6d5355a..2127599 100644
--- a/debian/bacula-sd.init
+++ b/debian/bacula-sd.init
@@ -43,9 +43,9 @@ fi
 CONFIG="${CONFIG:-/etc/bacula/$NAME.conf}"
 STOPTIMEOUT="${STOPTIMEOUT:-180}"
 
-create_var_run_dir
+create_run_dir
 
-PIDFILE=/var/run/bacula/$NAME.$PORT.pid
+PIDFILE=/run/bacula/$NAME.$PORT.pid
 
 do_start()
 {
diff --git a/debian/changelog b/debian/changelog
index 8081712..6dad477 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ bacula (7.4.3+dfsg-4) experimental; urgency=medium
   * Fix init scripts to make sure the daemons can be stopped before
     upgrades or when /etc/defaults/bacula-* were edited
     (merged from 7.4.3+dfsg-1+sid1)
+  * Use /run and /run/lock instead of /var/run and /var/lock
 
   Continue reorganisation of packages:
 
diff --git a/debian/rules b/debian/rules
index 2c62153..686d943 100755
--- a/debian/rules
+++ b/debian/rules
@@ -40,10 +40,10 @@ CONF_ALL	= \
 	--sharedstatedir=/var/lib/bacula \
 	--localstatedir=/var/lib/bacula \
 	--with-logdir=/var/log/bacula \
-	--with-pid-dir=/var/run/bacula \
+	--with-pid-dir=/run/bacula \
 	--with-smtp-host=localhost \
 	--with-working-dir=/var/lib/bacula \
-	--with-subsys-dir=/var/lock \
+	--with-subsys-dir=/run/lock \
 	--with-dump-email=root \
 	--with-job-email=root \
 	--with-mysql --with-postgresql --with-sqlite3 \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bacula/bacula.git



More information about the pkg-bacula-commits mailing list