Dear developer find attached the bundle patch to add systemd support for bacula
Distributions like fedora15 and next 16, openSUSE 12.1 (release in few days)
will be able to use it
The patch is delivered without a rebuilded version of ./configure script (avoid
~28KB lines of review)
once configure is rebuild you can add --enable-systemd as an option
I personally use those services from more than 8 weeks without noticing a
trouble with.
We already use that on our new community packages we are building actually in
our devel/testing repository
see build.opensuse.org (
https://build.opensuse.org/project/show?project=Archiving%3ABackup%3AFactory )
More news about that are in the queue : here the overview about what we
(Ioda-Net Sàrl & dassIT) will be able
to offer in a short time frame
CentOS_CentOS-5 i586 succeeded
CentOS_CentOS-5 x86_64 succeeded
CentOS_CentOS-6 i586 succeeded
CentOS_CentOS-6 x86_64 succeeded
Fedora_14 i586 succeeded
Fedora_14 x86_64 succeeded
Fedora_15 i586 succeeded
Fedora_15 x86_64 succeeded
openSUSE_11.3 i586 succeeded
openSUSE_11.3 x86_64 succeeded
openSUSE_11.4 i586 succeeded
openSUSE_11.4 x86_64 succeeded
openSUSE_12.1 x86_64 succeeded
openSUSE_12.1 i586 succeeded
openSUSE_Factory x86_64 succeeded
openSUSE_Factory i586 succeeded
openSUSE_Tumbleweed i586 succeeded
openSUSE_Tumbleweed x86_64 succeeded
RedHat_RHEL-5 i586 succeeded
RedHat_RHEL-5 x86_64 succeeded
RedHat_RHEL-6 i586 succeeded
RedHat_RHEL-6 x86_64 succeeded
SLE_11_SP1 i586 succeeded
SLE_11_SP1 x86_64 succeeded
The patch didn't impact any core components features, and has followed all of
you previous recommendations.
I hope its actual state meet your quality expectation
ps : if any .deb packager want to join our team, just ping us so we can add
support to Debian and Ubuntu too.
--
Bruno Friedmann
Ioda-Net Sàrl www.ioda-net.ch
openSUSE Member & Ambassador
GPG KEY : D5C9B751C4653227
irc: tigerfoot
>From 71ee513c6503fc717aa46e3f3f6b9ded1cdef1f7 Mon Sep 17 00:00:00 2001
From: Bruno Friedmann <br...@ioda-net.ch>
Date: Wed, 2 Nov 2011 10:06:28 +0100
Subject: [PATCH] Add systemd init scripts & options, without configure
---
bacula/autoconf/configure.in | 24 +++++--
bacula/platforms/Makefile.in | 2 +-
bacula/platforms/systemd/Makefile.in | 97 ++++++++++++++++++++++++
bacula/platforms/systemd/bacula-dir.service.in | 32 ++++++++
bacula/platforms/systemd/bacula-fd.service.in | 30 +++++++
bacula/platforms/systemd/bacula-sd.service.in | 30 +++++++
6 files changed, 208 insertions(+), 7 deletions(-)
create mode 100644 bacula/platforms/systemd/Makefile.in
create mode 100644 bacula/platforms/systemd/bacula-dir.service.in
create mode 100644 bacula/platforms/systemd/bacula-fd.service.in
create mode 100644 bacula/platforms/systemd/bacula-sd.service.in
diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in
index 7c67158..411b3aa 100644
--- a/bacula/autoconf/configure.in
+++ b/bacula/autoconf/configure.in
@@ -3105,8 +3105,7 @@ redhat)
platforms/redhat/Makefile \
platforms/redhat/bacula-fd \
platforms/redhat/bacula-sd \
- platforms/redhat/bacula-dir
- "
+ platforms/redhat/bacula-dir"
;;
mandrake)
DISTVER=`cat /etc/mandrake-release | grep release |\
@@ -3117,8 +3116,7 @@ mandrake)
platforms/mandrake/Makefile \
platforms/mandrake/bacula-fd \
platforms/mandrake/bacula-sd \
- platforms/mandrake/bacula-dir \
- "
+ platforms/mandrake/bacula-dir"
;;
gentoo)
DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
@@ -3126,7 +3124,7 @@ gentoo)
PSCMD="ps -e -o pid,command"
PFILES="${PFILES} \
platforms/gentoo/Makefile \
- platforms/gentoo/bacula-init \
+ platforms/gentoo/bacula-init \
platforms/gentoo/bacula-fd \
platforms/gentoo/bacula-sd \
platforms/gentoo/bacula-dir"
@@ -3139,7 +3137,7 @@ slackware)
platforms/slackware/Makefile \
platforms/slackware/rc.bacula-fd \
platforms/slackware/rc.bacula-sd \
- platforms/slackware/rc.bacula-dir\
+ platforms/slackware/rc.bacula-dir \
platforms/slackware/functions.bacula"
;;
solaris)
@@ -3197,6 +3195,20 @@ unknown)
;;
esac
+dnl -------------------------------------------
+dnl systemd (default off)
+dnl -------------------------------------------
+AC_ARG_ENABLE(systemd,
+ AC_HELP_STRING([--enable-systemd], [enable creation of systemd service files@<:@default=no@:>@]),
+ [
+ PFILES="${PFILES} \
+ platforms/systemd/Makefile \
+ platforms/systemd/bacula-dir.service \
+ platforms/systemd/bacula-fd.service \
+ platforms/systemd/bacula-sd.service"
+ ]
+)
+
AC_SUBST(hostname)
LIBS="$PTHREAD_LIB $LIBS"
diff --git a/bacula/platforms/Makefile.in b/bacula/platforms/Makefile.in
index 79101b0..bba619b 100644
--- a/bacula/platforms/Makefile.in
+++ b/bacula/platforms/Makefile.in
@@ -12,7 +12,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL = @INSTALL@
SUBDIRS = freebsd redhat solaris unknown openbsd osx irix gentoo \
- debian darwin aix bsdi mandrake slackware alpha ubuntu
+ debian darwin aix bsdi mandrake slackware alpha ubuntu systemd
MAKE = make
diff --git a/bacula/platforms/systemd/Makefile.in b/bacula/platforms/systemd/Makefile.in
new file mode 100644
index 0000000..826c958
--- /dev/null
+++ b/bacula/platforms/systemd/Makefile.in
@@ -0,0 +1,97 @@
+#
+# This file is used as the template to create the
+# Makefile for the systemd specific installation.
+#
+#
+# for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
+#
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+# should be /lib/systemd/system and get be get with
+# systemctl show | grep UnitPath | cut -d " " -f2
+SYSTEMD_UNITDIR = @SYSTEMD_UNITDIR@
+
+nothing:
+
+install: install-autostart
+
+install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir
+
+
+install-autostart-fd:
+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-fd.service; then \
+ /bin/systemctl stop bacula-fd.service; \
+ /bin/systemctl disable bacula-fd.service; \
+ fi
+ @$(INSTALL_PROGRAM) -m 644 bacula-fd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-fd.service
+ # set symlinks for script at startup and shutdown
+ @if test x$(DESTDIR) = x ; then \
+ /bin/systemctl enable bacula-fd.service; \
+ /bin/systemctl start bacula-fd.service; \
+ fi
+
+
+install-autostart-sd:
+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-sd.service; then \
+ /bin/systemctl stop bacula-sd.service; \
+ /bin/systemctl disable bacula-sd.service; \
+ fi
+ @$(INSTALL_PROGRAM) -m 644 bacula-sd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-sd.service
+ # set symlinks for script at startup and shutdown
+ @if test x$(DESTDIR) = x ; then \
+ /bin/systemctl enable bacula-sd.service; \
+ /bin/systemctl start bacula-sd.service; \
+ fi
+
+
+install-autostart-dir:
+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-dir.service; then \
+ /bin/systemctl stop bacula-dir.service; \
+ /bin/systemctl disable bacula-dir.service; \
+ fi
+ @$(INSTALL_PROGRAM) -m 644 bacula-dir.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-dir.service
+ # set symlinks for script at startup and shutdown
+ @if test x$(DESTDIR) = x ; then \
+ /bin/systemctl enable bacula-dir.service; \
+ /bin/systemctl start bacula-dir.service; \
+ fi
+
+
+uninstall: uninstall-autostart
+
+uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir
+
+uninstall-autostart-fd:
+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-fd.service; then \
+ /bin/systemctl stop bacula-fd.service; \
+ /bin/systemctl disable bacula-fd.service; \
+ fi
+ @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-fd.service
+
+
+uninstall-autostart-sd:
+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-sd.service; then \
+ /bin/systemctl stop bacula-fd.service; \
+ /bin/systemctl disable bacula-fd.service; \
+ fi
+ @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-sd.service
+
+uninstall-autostart-dir:
+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD)/bacula-dir.service; then \
+ /bin/systemctl stop bacula-dir.service; \
+ /bin/systemctl disable bacula-dir.service; \
+ fi
+ @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-dir.service
+
+clean:
+ @rm -f 1 2 3
+
+distclean: clean
+ @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
+ @rm -f bacula-sd.service bacula-fd.service bacula-dir.service
+
+devclean: clean
+ @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
+ @rm -f bacula-sd.service bacula-fd.service bacula-dir.service
+
diff --git a/bacula/platforms/systemd/bacula-dir.service.in b/bacula/platforms/systemd/bacula-dir.service.in
new file mode 100644
index 0000000..7f18b84
--- /dev/null
+++ b/bacula/platforms/systemd/bacula-dir.service.in
@@ -0,0 +1,32 @@
+# This file is part of package Bacula Director Daemon
+#
+# Copyright (c) 2011 Free Software Foundation Europe e.V.
+# Bacula Community
+# Author: Bruno Friedmann
+# Description:
+# Used to start the bacula director daemon service (bacula-dir)
+# will be installed as /lib/systemd/system/bacula-dir.service
+# enable : systemctl enable bacula-dir.service
+# start : systemctl start bacula-dir.service
+#
+# Bacula Director Daemon service
+#
+[Unit]
+Description=Bacula Director Daemon service
+Requires=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target
+After=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target
+Wants=@DB_TYPE@.service
+# Before=
+# Conflicts=
+
+[Service]
+Type=forking
+PIDFile=@piddir@/bacula-dir.pid
+# EnvironmentFile=-/etc/sysconfig/bacula-dir
+StandardOutput=syslog
+ExecStart=@sbindir@/bacula-dir -u @dir_user@ -g @dir_group@ -c @sysconfdir@/bacula-dir.conf
+# This daemon should be able to reload the conf file
+#ExecReload=/sbin/killproc -p @piddir@/bacula-dir.pid -HUP @sbindir@/bacula-dir
+
+[Install]
+WantedBy=multi-user.target
diff --git a/bacula/platforms/systemd/bacula-fd.service.in b/bacula/platforms/systemd/bacula-fd.service.in
new file mode 100644
index 0000000..23169c5
--- /dev/null
+++ b/bacula/platforms/systemd/bacula-fd.service.in
@@ -0,0 +1,30 @@
+File daemon ( actually work well)
+# This file is part of package Bacula File Daemon
+#
+# Copyright (c) 2011 Free Software Foundation Europe e.V.
+# Bacula Community
+# Author: Bruno Friedmann
+# Description:
+# Used to start the bacula file daemon service (bacula-fd)
+# will be installed as /lib/systemd/system/bacula-fd.service
+# enable : systemctl enable bacula-fd.service
+# start : systemctl start bacula-fd.service
+#
+# Bacula File Daemon service
+#
+[Unit]
+Description=Bacula File Daemon service
+Requires=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target
+After=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target
+# Wants=
+# Before=
+# Conflicts=
+
+[Service]
+Type=forking
+PIDFile=@piddir@/bacula-fd.pid
+StandardOutput=syslog
+ExecStart=@sbindir@/bacula-fd -u @fd_user@ -g @fd_group@ -c @sysconfdir@/bacula-fd.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/bacula/platforms/systemd/bacula-sd.service.in b/bacula/platforms/systemd/bacula-sd.service.in
new file mode 100644
index 0000000..58687dc
--- /dev/null
+++ b/bacula/platforms/systemd/bacula-sd.service.in
@@ -0,0 +1,30 @@
+# This file is part of package Bacula Storage Daemon
+#
+# Copyright (c) 2011 Free Software Foundation Europe e.V.
+# for Bacula Community
+# Author: Bruno Friedmann
+# Description:
+# Used to start the bacula storage daemon service (bacula-sd)
+# will be installed as /lib/systemd/system/bacula-sd.service
+# enable : systemctl enable bacula-sd.service
+# start : systemctl start bacula-sd.service
+#
+# Bacula Storage Daemon service
+#
+[Unit]
+Description=Bacula Storage Daemon service
+Requires=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target
+After=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target
+# Wants=
+# Before=
+# Conflicts=
+
+[Service]
+Type=forking
+PIDFile=@piddir@/bacula-sd.pid
+# EnvironmentFile=-/etc/sysconfig/bacula-sd
+StandardOutput=syslog
+ExecStart=@sbindir@/bacula-sd -u @sd_user@ -g @sd_group@ -c @sysconfdir@/bacula-sd.conf
+
+[Install]
+WantedBy=multi-user.target
--
1.7.7
------------------------------------------------------------------------------
RSA® Conference 2012
Save $700 by Nov 18
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel