[pkg-bacula-commits] [bacula] 01/01: honour /etc/defaults/bacula-* in systemd service files

Carsten Leonhardt leo at moszumanska.debian.org
Mon Jun 13 13:13:14 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 1e99f35e0b2c07b1bfe2d15d70dba4b0ced161ce
Author: Carsten Leonhardt <leo at debian.org>
Date:   Mon Jun 13 15:12:35 2016 +0200

    honour /etc/defaults/bacula-* in systemd service files
---
 debian/TODO                                        |  8 ----
 debian/changelog                                   |  1 +
 debian/patches/deb-fix-systemd-service-files       | 44 +++++++++++++++++++
 debian/patches/series                              |  2 +-
 .../service-files-user-group-settings.patch        | 51 ----------------------
 5 files changed, 46 insertions(+), 60 deletions(-)

diff --git a/debian/TODO b/debian/TODO
index 3e9b8e0..53466bd 100644
--- a/debian/TODO
+++ b/debian/TODO
@@ -1,11 +1,3 @@
-High:
-
- * either warn users that /etc/defaults/bacula-* are ignored on
-   systems with systemd, or add magic that translates the defaults to
-   the systemd service files (or simply let systemd start the daemons
-   as root and pass the arguments like in the init files)
-   - see https://www.freedesktop.org/software/systemd/man/systemd.service.html
-
 Normal:
 
  * With the next upstream release, switch back to using "+dfsg", as
diff --git a/debian/changelog b/debian/changelog
index 6bde67c..8afcddd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ bacula (7.4.1~dfsg-2) unstable; urgency=low
   * Add functioning native systemd support. Thanks to Sven Hartge.
   * Test config before attempting to start daemons via systemd, avoids
     regression of #825064
+  * Honour /etc/defaults/bacula-* in systemd service files
 
  --
 
diff --git a/debian/patches/deb-fix-systemd-service-files b/debian/patches/deb-fix-systemd-service-files
new file mode 100644
index 0000000..df94cda
--- /dev/null
+++ b/debian/patches/deb-fix-systemd-service-files
@@ -0,0 +1,44 @@
+Description: fix systemd service files for debian
+ - execute config test before starting a daemon
+ - honour default-files contents
+ this patch is packaging-specific
+Author: Carsten Leonhardt <leo at debian.org>
+--- a/platforms/systemd/bacula-dir.service.in
++++ b/platforms/systemd/bacula-dir.service.in
+@@ -25,7 +25,9 @@
+ Type=forking
+ User=@dir_user@
+ Group=@dir_group@
+-ExecStart=@sbindir@/bacula-dir -c @sysconfdir@/bacula-dir.conf
++EnvironmentFile=-/etc/default/bacula-dir
++ExecStartPre=@sbindir@/bacula-dir -t -c $CONFIG $ARGS
++ExecStart=@sbindir@/bacula-dir -c $CONFIG $ARGS
+ PIDFile=@piddir@/bacula-dir. at dir_port@.pid
+ ExecReload=@sbindir@/bacula-dir -t -c @sysconfdir@/bacula-dir.conf
+ ExecReload=/bin/kill -HUP $MAINPID
+--- a/platforms/systemd/bacula-fd.service.in
++++ b/platforms/systemd/bacula-fd.service.in
+@@ -25,7 +25,9 @@
+ Type=forking
+ User=@fd_user@
+ Group=@fd_group@
+-ExecStart=@sbindir@/bacula-fd -c @sysconfdir@/bacula-fd.conf
++EnvironmentFile=-/etc/default/bacula-fd
++ExecStartPre=@sbindir@/bacula-fd -t -c $CONFIG $ARGS
++ExecStart=@sbindir@/bacula-fd -c $CONFIG $ARGS
+ PIDFile=@piddir@/bacula-fd. at fd_port@.pid
+ StandardError=syslog
+ 
+--- a/platforms/systemd/bacula-sd.service.in
++++ b/platforms/systemd/bacula-sd.service.in
+@@ -24,7 +24,9 @@
+ Type=forking
+ User=@sd_user@
+ Group=@sd_group@
+-ExecStart=@sbindir@/bacula-sd -c @sysconfdir@/bacula-sd.conf
++EnvironmentFile=-/etc/default/bacula-sd
++ExecStartPre=@sbindir@/bacula-sd -t -c $CONFIG $ARGS
++ExecStart=@sbindir@/bacula-sd -c $CONFIG $ARGS
+ PIDFile=@piddir@/bacula-sd. at sd_port@.pid
+ StandardError=syslog
+ 
diff --git a/debian/patches/series b/debian/patches/series
index b2bb1bc..e864d90 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,4 +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
+deb-fix-systemd-service-files
\ No newline at end of file
diff --git a/debian/patches/service-files-user-group-settings.patch b/debian/patches/service-files-user-group-settings.patch
deleted file mode 100644
index bdfa3f2..0000000
--- a/debian/patches/service-files-user-group-settings.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Description: hardcode bacula user and group settings, add configuration tests
- 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.
- Add configuration tests to have a warning when bacula doesn't start
-Author: Sven Hartge <sven at svenhartge.de>
-Author: Carsten Leonhardt <leo at debian.org>
---- a/platforms/systemd/bacula-dir.service.in
-+++ b/platforms/systemd/bacula-dir.service.in
-@@ -23,8 +23,9 @@
- # From http://www.freedesktop.org/software/systemd/man/systemd.service.html
- [Service]
- Type=forking
--User=@dir_user@
--Group=@dir_group@
-+User=bacula
-+Group=bacula
-+ExecStartPre=@sbindir@/bacula-dir -t -c @sysconfdir@/bacula-dir.conf
- 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
---- a/platforms/systemd/bacula-fd.service.in
-+++ b/platforms/systemd/bacula-fd.service.in
-@@ -23,8 +23,9 @@
- # from http://www.freedesktop.org/software/systemd/man/systemd.service.html
- [Service]
- Type=forking
--User=@fd_user@
--Group=@fd_group@
-+User=root
-+Group=root
-+ExecStartPre=@sbindir@/bacula-fd -t -c @sysconfdir@/bacula-fd.conf
- ExecStart=@sbindir@/bacula-fd -c @sysconfdir@/bacula-fd.conf
- PIDFile=@piddir@/bacula-fd. at fd_port@.pid
- StandardError=syslog
---- a/platforms/systemd/bacula-sd.service.in
-+++ b/platforms/systemd/bacula-sd.service.in
-@@ -22,8 +22,9 @@
- # from http://www.freedesktop.org/software/systemd/man/systemd.service.html
- [Service]
- Type=forking
--User=@sd_user@
--Group=@sd_group@
-+User=bacula
-+Group=tape
-+ExecStartPre=@sbindir@/bacula-sd -t -c @sysconfdir@/bacula-sd.conf
- ExecStart=@sbindir@/bacula-sd -c @sysconfdir@/bacula-sd.conf
- PIDFile=@piddir@/bacula-sd. at sd_port@.pid
- StandardError=syslog

-- 
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