[pkg-bacula-commits] [bacula] 01/01: Move director init script and services files to director-DBTYPE package
Sven Hartge
hartge-guest at moszumanska.debian.org
Sun Jul 17 14:38:54 UTC 2016
This is an automated email from the git hooks/post-receive script.
hartge-guest pushed a commit to branch master-systemd
in repository bacula.
commit 9c6d38aaf2628956298d3a198df5effd67fe38ef
Author: Sven Hartge <sven at svenhartge.de>
Date: Sun Jul 17 16:29:03 2016 +0200
Move director init script and services files to director-DBTYPE package
This moves the init script and systemd services from
bacula-director-common to bacula-diretor-DBTYPE.
The init script and service file is identical in each case and thus
obviously qualifies for the common package, them being there make the
handling of the stopping and starting of the services during package
upgrades more complicated because you can't reliably use dh_installinit
and dh_systemd_start but have to hard-code some of the invoke-rc.d
calls.
Having the init scripts and the service files inside
bacula-director-DBTYPE allows us to remove the hard-coded call to
invoke-rc.d in the prerm/postinst and just use the default call to
dh_installinit and dh_systemd_start in debian/rules, being able to take
immediate gain if those scripts improve their in the future without
having to manually change or adapt the prerm/postinst.
This also should improve BinNMU'ability if ever one is needed for a
debhelper update.
TODO: moving the init-script from one package to another could
need a versioned Conflicts/Breaks, but I am not 100% sure about that.
bacula-director-DBTYPE alreads depends on the same version of
bacula-director-common meaning bacula-director-common should be
installed before bacula-director-DBTYPE. But again, I am not sure about
this. Needs more investigation.
---
...or.init => bacula-director-db.bacula-director.init.in} | 0
debian/bacula-director-db.postinst.in | 3 ++-
debian/bacula-director-db.prerm.in | 4 ----
debian/rules | 15 +++++++++------
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/debian/bacula-director-common.bacula-director.init b/debian/bacula-director-db.bacula-director.init.in
similarity index 100%
rename from debian/bacula-director-common.bacula-director.init
rename to debian/bacula-director-db.bacula-director.init.in
diff --git a/debian/bacula-director-db.postinst.in b/debian/bacula-director-db.postinst.in
index e87d868..ebd9581 100644
--- a/debian/bacula-director-db.postinst.in
+++ b/debian/bacula-director-db.postinst.in
@@ -136,7 +136,8 @@ esac
# Do start daemon
db_stop
-invoke-rc.d bacula-director start || exit $?
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
#DEBHELPER#
diff --git a/debian/bacula-director-db.prerm.in b/debian/bacula-director-db.prerm.in
index 8f2cdcf..8b9a5c2 100644
--- a/debian/bacula-director-db.prerm.in
+++ b/debian/bacula-director-db.prerm.in
@@ -13,10 +13,6 @@ if [ -f /usr/share/dbconfig-common/dpkg/prerm.$THISDB ]; then
dbc_go bacula-director-$THISDB $@
fi
-if [ -x "/etc/init.d/bacula-director" ]; then
- invoke-rc.d bacula-director stop || exit $?
-fi
-
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
diff --git a/debian/rules b/debian/rules
index 33a5424..cce8e3f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -114,14 +114,15 @@ override_dh_shlibdeps:
-Nbacula-sd-pgsql -Nbacula-director-pgsql
override_dh_installinit-arch:
- dh_installinit -pbacula-sd -- defaults 90 10
- dh_installinit -pbacula-fd -- defaults 91 9
- dh_installinit -pbacula-director-common --name=bacula-director --no-start -- defaults 92 8
+ dh_installinit -pbacula-sd --no-restart-after-upgrade -- defaults
+ dh_installinit -pbacula-fd --no-restart-after-upgrade -- defaults
+ dh_installinit -pbacula-director-mysql --name=bacula-director --no-restart-after-upgrade -- defaults
+ dh_installinit -pbacula-director-sqlite3 --name=bacula-director --no-restart-after-upgrade -- defaults
+ dh_installinit -pbacula-director-pgsql --name=bacula-director --no-restart-after-upgrade -- defaults
-override_dh_systemd_start:
+override_dh_systemd_start-arch:
dh_systemd_start -pbacula-sd --no-restart-after-upgrade bacula-sd.service
dh_systemd_start -pbacula-fd --no-restart-after-upgrade bacula-fd.service
- dh_systemd_start -pbacula-director-common --no-restart-after-upgrade --no-start bacula-director.service
dh_systemd_start -pbacula-director-mysql --no-restart-after-upgrade bacula-director.service
dh_systemd_start -pbacula-director-sqlite3 --no-restart-after-upgrade bacula-director.service
dh_systemd_start -pbacula-director-pgsql --no-restart-after-upgrade bacula-director.service
@@ -141,7 +142,9 @@ ifeq ($(HAVE_SYSTEMD),1)
# only install systemd related files if systemd is enabled during build
install -m 644 platforms/systemd/bacula-fd.service -D debian/bacula-fd/lib/systemd/system/bacula-fd.service
install -m 644 platforms/systemd/bacula-sd.service -D debian/bacula-sd/lib/systemd/system/bacula-sd.service
- install -m 644 platforms/systemd/bacula-dir.service -D debian/bacula-director-common/lib/systemd/system/bacula-director.service
+ install -m 644 platforms/systemd/bacula-dir.service -D debian/bacula-director-mysql/lib/systemd/system/bacula-director.service
+ install -m 644 platforms/systemd/bacula-dir.service -D debian/bacula-director-sqlite3/lib/systemd/system/bacula-director.service
+ install -m 644 platforms/systemd/bacula-dir.service -D debian/bacula-director-pgsql/lib/systemd/system/bacula-director.service
endif
override_dh_installdocs:
--
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