[pkg-bacula-commits] [bacula] 01/02: enable native systemd support
Carsten Leonhardt
leo at moszumanska.debian.org
Sun Jun 12 22:38:08 UTC 2016
This is an automated email from the git hooks/post-receive script.
leo pushed a commit to branch master
in repository bacula.
commit 0b48e6dcce098ab07fe135697ee4a1efa6df2aed
Author: Sven Hartge <sven at svenhartge.de>
Date: Mon Jun 13 00:16:19 2016 +0200
enable native systemd support
---
debian/changelog | 8 ++++
debian/control | 1 +
debian/patches/series | 1 +
.../service-files-user-group-settings.patch | 46 ++++++++++++++++++++++
debian/rules | 24 ++++++-----
5 files changed, 70 insertions(+), 10 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index efa2bfb..f295e3e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+bacula (7.4.1~dfsg-1.2) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Re-enable systemd support for Linux, provide systemd-activation
+ via dh-systemd
+
+ -- Sven Hartge <sven at svenhartge.de> Fri, 10 Jun 2016 12:44:49 +0200
+
bacula (7.4.1~dfsg-1) unstable; urgency=high
* New upstream release
diff --git a/debian/control b/debian/control
index 98c0203..3094eb6 100644
--- a/debian/control
+++ b/debian/control
@@ -8,6 +8,7 @@ Build-Depends:
autotools-dev,
bc,
debhelper (>= 9),
+ dh-systemd (>= 1.5) [linux-any],
libacl1-dev,
libcap-dev [linux-any],
libgnome2-dev,
diff --git a/debian/patches/series b/debian/patches/series
index 77011cc..b2bb1bc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@ fix-libbaccats-rpath.patch
fix-mysql-libdir.patch
fix-scriptdir-examples-devices.patch
enable-hardening-for-bat.patch
+service-files-user-group-settings.patch
diff --git a/debian/patches/service-files-user-group-settings.patch b/debian/patches/service-files-user-group-settings.patch
new file mode 100644
index 0000000..b55b09b
--- /dev/null
+++ b/debian/patches/service-files-user-group-settings.patch
@@ -0,0 +1,46 @@
+Description: hardcode bacula user and group settings
+ hardcode the bacula user and groups into the systemd service files
+ templates.
+ Specifying this via configure option is not possible, as this would
+ require the existance of the provided users and groups during compile
+ time.
+Author: Sven Hartge <sven at svenhartge.de>
+--- bacula-7.4.1~dfsg.orig/platforms/systemd/bacula-dir.service.in
++++ bacula-7.4.1~dfsg/platforms/systemd/bacula-dir.service.in
+@@ -23,8 +23,8 @@ RequiresMountsFor=@working_dir@ @sysconf
+ # From http://www.freedesktop.org/software/systemd/man/systemd.service.html
+ [Service]
+ Type=forking
+-User=@dir_user@
+-Group=@dir_group@
++User=bacula
++Group=bacula
+ ExecStart=@sbindir@/bacula-dir -c @sysconfdir@/bacula-dir.conf
+ PIDFile=@piddir@/bacula-dir. at dir_port@.pid
+ ExecReload=@sbindir@/bacula-dir -t -c @sysconfdir@/bacula-dir.conf
+--- bacula-7.4.1~dfsg.orig/platforms/systemd/bacula-fd.service.in
++++ bacula-7.4.1~dfsg/platforms/systemd/bacula-fd.service.in
+@@ -23,8 +23,8 @@ RequiresMountsFor=@working_dir@ @sysconf
+ # from http://www.freedesktop.org/software/systemd/man/systemd.service.html
+ [Service]
+ Type=forking
+-User=@fd_user@
+-Group=@fd_group@
++User=root
++Group=root
+ ExecStart=@sbindir@/bacula-fd -c @sysconfdir@/bacula-fd.conf
+ PIDFile=@piddir@/bacula-fd. at fd_port@.pid
+ StandardError=syslog
+--- bacula-7.4.1~dfsg.orig/platforms/systemd/bacula-sd.service.in
++++ bacula-7.4.1~dfsg/platforms/systemd/bacula-sd.service.in
+@@ -22,8 +22,8 @@ RequiresMountsFor=@working_dir@ @sysconf
+ # from http://www.freedesktop.org/software/systemd/man/systemd.service.html
+ [Service]
+ Type=forking
+-User=@sd_user@
+-Group=@sd_group@
++User=bacula
++Group=tape
+ ExecStart=@sbindir@/bacula-sd -c @sysconfdir@/bacula-sd.conf
+ PIDFile=@piddir@/bacula-sd. at sd_port@.pid
+ StandardError=syslog
diff --git a/debian/rules b/debian/rules
index 1081be6..5816fc4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -49,16 +49,16 @@ CONF_ALL = \
--with-mysql --with-postgresql --with-sqlite3 \
--enable-bat --with-x
-#ifeq ($(DEB_HOST_ARCH_OS),linux)
-#CONF_ALL += --with-systemd=/lib/systemd/system
-#endif
+ifeq ($(DEB_HOST_ARCH_OS),linux)
+CONF_ALL += --with-systemd=/lib/systemd/system
+endif
ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
CONF_ALL += --disable-acl --disable-xattr
endif
#set to 1 if configured with systemd
-#HAVE_SYSTEMD = $(findstring 1,$(shell egrep "^\#define HAVE_SYSTEMD" config.log))
+HAVE_SYSTEMD = $(findstring 1,$(shell egrep "^\#define HAVE_SYSTEMD" config.log))
LONGNAME_mysql = mysql
LONGNAME_pgsql = postgresql
@@ -93,7 +93,11 @@ $(foreach template,$(wildcard debian/*-db.*.in),$(call template-cleanup,$(templa
endef
%:
+ifeq ($(HAVE_SYSTEMD),1)
+ dh $@ --with autotools_dev,systemd --parallel
+else
dh $@ --with autotools_dev --parallel
+endif
override_dh_shlibdeps:
# Handle shlibs for the database packages specially so they get
@@ -131,12 +135,12 @@ override_dh_install-arch:
-e "s/XX_DBLONGNAME_XX/$(LONGNAME_$(db))/" \
debian/bacula-director-$(db)/etc/bacula/scripts/make_catalog_backup \
debian/bacula-director-$(db)/etc/bacula/scripts/make_catalog_backup.pl;)
-#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
-#endif
+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
+endif
override_dh_installdocs:
dh_installdocs -pbacula --link-doc=bacula-server
--
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