]> git.sur5r.net Git - bacula/bacula/commitdiff
Use Debian systemd start/stop scripts supplied by Sven Hartge
authorKern Sibbald <kern@sibbald.com>
Tue, 31 Oct 2017 10:04:46 +0000 (11:04 +0100)
committerKern Sibbald <kern@sibbald.com>
Tue, 31 Oct 2017 10:04:46 +0000 (11:04 +0100)
bacula/platforms/systemd/Makefile.in
bacula/platforms/systemd/bacula-dir.service.in
bacula/platforms/systemd/bacula-fd.service.in
bacula/platforms/systemd/bacula-sd.service.in

index f749bb3fd6422a2115da806dc475c08e896a28a9..0db4d5598e0e9261c94ff966977d86294b7974bc 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2000-2016 Kern Sibbald
+# Copyright (C) 2000-2017 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 #
 # This file is used as the template to create the
@@ -21,55 +21,55 @@ nothing:
 install: install-dir install-conf install-autostart
 
 install-dir:
-       mkdir -p $(DESTDIR)/$(SYSTEMD_UNITDIR) $(DESTDIR)/$(SYSTEMD_TMPFILES)
+        mkdir -p $(DESTDIR)/$(SYSTEMD_UNITDIR) $(DESTDIR)/$(SYSTEMD_TMPFILES)
 
 install-conf:
-       @$(INSTALL_PROGRAM) -m 644 bacula.conf $(DESTDIR)/$(SYSTEMD_TMPFILES)/bacula.conf
+        @$(INSTALL_PROGRAM) -m 644 bacula.conf $(DESTDIR)/$(SYSTEMD_TMPFILES)/bacula.conf
 
 install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir
 
 install-service:
-       @$(INSTALL_PROGRAM) -m 644 bacula-fd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)
-       @$(INSTALL_PROGRAM) -m 644 bacula-dir.service $(DESTDIR)/$(SYSTEMD_UNITDIR)
-       @$(INSTALL_PROGRAM) -m 644 bacula-sd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)
+        @$(INSTALL_PROGRAM) -m 644 bacula-fd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)
+        @$(INSTALL_PROGRAM) -m 644 bacula-dir.service $(DESTDIR)/$(SYSTEMD_UNITDIR)
+        @$(INSTALL_PROGRAM) -m 644 bacula-sd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)
 
 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
+        @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
+        @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
+        @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-conf
@@ -77,37 +77,37 @@ uninstall: uninstall-autostart uninstall-conf
 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
+        @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
+        @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
+        @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
 
 uninstall-conf:
-       @rm -f  $(DESTDIR)/$(SYSTEMD_TMPFILES)/bacula.conf
+        @rm -f  $(DESTDIR)/$(SYSTEMD_TMPFILES)/bacula.conf
 
 clean:
-       @rm -f 1 2 3
+        @rm -f 1 2 3
 
 distclean: clean
-       @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
-       @rm -f bacula.conf bacula-sd.service bacula-fd.service bacula-dir.service
+        @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
+        @rm -f bacula.conf bacula-sd.service bacula-fd.service bacula-dir.service
 
 devclean: clean
-       @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
-       @rm -f bacula.conf bacula-sd.service bacula-fd.service bacula-dir.service
+        @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec
+        @rm -f bacula.conf bacula-sd.service bacula-fd.service bacula-dir.service
index 8fc3cfea364ee460cac9d35b5ed36d5ad9da59c6..1f26a4a297b041222bcd5cbaf6417090413cd979 100644 (file)
@@ -1,6 +1,6 @@
 # Systemd Bacula service file
 #
-# Copyright (C) 2000-2016 Kern Sibbald
+# Copyright (C) 2000-2017 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 #
 # /lib/systemd/system/bacula-dir.service
@@ -22,14 +22,13 @@ RequiresMountsFor=@working_dir@ @sysconfdir@ @sbindir@ @piddir@
 
 # From http://www.freedesktop.org/software/systemd/man/systemd.service.html
 [Service]
-Type=forking
+Type=simple
 User=@dir_user@
 Group=@dir_group@
-ExecStart=@sbindir@/bacula-dir -c @sysconfdir@/bacula-dir.conf
-PIDFile=@piddir@/bacula-dir.@dir_port@.pid
+ExecStart=@sbindir@/bacula-dir -fP -c @sysconfdir@/bacula-dir.conf
 ExecReload=@sbindir@/bacula-dir -t -c @sysconfdir@/bacula-dir.conf
 ExecReload=/bin/kill -HUP $MAINPID
-StandardError=syslog
+SuccessExitStatus=15
 
 [Install]
 WantedBy=multi-user.target
index 589905870fdf87551ad32e3040af342904a391eb..f283a95948ab905c9082ecf4421e5320fca5acbd 100644 (file)
@@ -1,6 +1,6 @@
 # Systemd Bacula service file
 #
-# Copyright (C) 2000-2016 Kern Sibbald
+# Copyright (C) 2000-2017 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 #
 # /lib/systemd/system/bacula-fd.service
@@ -22,12 +22,11 @@ RequiresMountsFor=@working_dir@ @sysconfdir@ @sbindir@ @piddir@
 
 # from http://www.freedesktop.org/software/systemd/man/systemd.service.html
 [Service]
-Type=forking
+Type=simple
 User=@fd_user@
 Group=@fd_group@
-ExecStart=@sbindir@/bacula-fd -c @sysconfdir@/bacula-fd.conf
-PIDFile=@piddir@/bacula-fd.@fd_port@.pid
-StandardError=syslog
+ExecStart=@sbindir@/bacula-fd -fP -c @sysconfdir@/bacula-fd.conf
+SuccessExitStatus=15
 
 [Install]
 WantedBy=multi-user.target
index 6f909bdb65ee679ec906774953cb9520852da0d4..839605cd3fb7384cbd3f2c03d010ad90993d9a5f 100644 (file)
@@ -1,6 +1,6 @@
 # Systemd Bacula service file
 #
-# Copyright (C) 2000-2016 Kern Sibbald
+# Copyright (C) 2000-2017 Kern Sibbald
 # License: BSD 2-Clause; see file LICENSE-FOSS
 #
 # /lib/systemd/system/bacula-sd.service
@@ -21,12 +21,11 @@ RequiresMountsFor=@working_dir@ @sysconfdir@ @sbindir@ @piddir@
 
 # from http://www.freedesktop.org/software/systemd/man/systemd.service.html
 [Service]
-Type=forking
+Type=simple
 User=@sd_user@
 Group=@sd_group@
-ExecStart=@sbindir@/bacula-sd -c @sysconfdir@/bacula-sd.conf
-PIDFile=@piddir@/bacula-sd.@sd_port@.pid
-StandardError=syslog
+ExecStart=@sbindir@/bacula-sd -fP -c @sysconfdir@/bacula-sd.conf
+SuccessExitStatus=15
 LimitMEMLOCK=infinity
 
 [Install]