Package: bacula / 7.4.4+dfsg-6

non-forking-systemd-units.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Description: Change systemd.units to non-forking simple mode
Author: Sven Hartge <sven@svenhartge.de>

--- a/platforms/systemd/bacula-dir.service.in
+++ b/platforms/systemd/bacula-dir.service.in
@@ -17,18 +17,21 @@
 [Unit]
 Description=Bacula Director Daemon service
 Requires=network.target
-After=network.target
+After=network.target postgresql.service mysql.service
 RequiresMountsFor=@working_dir@ @sysconfdir@ @sbindir@ @piddir@
 
 # From http://www.freedesktop.org/software/systemd/man/systemd.service.html
 [Service]
-Type=forking
-User=@dir_user@
-Group=@dir_group@
-ExecStart=@sbindir@/bacula-dir -c @sysconfdir@/bacula-dir.conf
-PIDFile=@piddir@/bacula-dir.@dir_port@.pid
-ExecReload=@sbindir@/bacula-dir -t -c @sysconfdir@/bacula-dir.conf
+Type=simple
+User=bacula
+Group=bacula
+Environment="CONFIG=/etc/bacula/bacula-dir.conf"
+EnvironmentFile=-/etc/default/bacula-dir
+ExecStartPre=@sbindir@/bacula-dir -t -c $CONFIG
+ExecStart=@sbindir@/bacula-dir -f -c $CONFIG
+ExecReload=@sbindir@/bacula-dir -t -c $CONFIG
 ExecReload=/bin/kill -HUP $MAINPID
+SuccessExitStatus=15
 StandardError=syslog
 
 [Install]
--- a/platforms/systemd/bacula-fd.service.in
+++ b/platforms/systemd/bacula-fd.service.in
@@ -22,11 +22,15 @@
 
 # from http://www.freedesktop.org/software/systemd/man/systemd.service.html
 [Service]
-Type=forking
-User=@fd_user@
-Group=@fd_group@
-ExecStart=@sbindir@/bacula-fd -c @sysconfdir@/bacula-fd.conf
-PIDFile=@piddir@/bacula-fd.@fd_port@.pid
+Type=simple
+User=root
+Group=root
+Environment="CONFIG=/etc/bacula/bacula-fd.conf"
+EnvironmentFile=-/etc/default/bacula-fd
+ExecStartPre=@sbindir@/bacula-fd -t -c $CONFIG
+ExecStart=@sbindir@/bacula-fd -f -c $CONFIG
+ExecReload=/bin/kill -HUP $MAINPID
+SuccessExitStatus=15
 StandardError=syslog
 
 [Install]
--- a/platforms/systemd/bacula-sd.service.in
+++ b/platforms/systemd/bacula-sd.service.in
@@ -21,11 +21,15 @@
 
 # from http://www.freedesktop.org/software/systemd/man/systemd.service.html
 [Service]
-Type=forking
-User=@sd_user@
-Group=@sd_group@
-ExecStart=@sbindir@/bacula-sd -c @sysconfdir@/bacula-sd.conf
-PIDFile=@piddir@/bacula-sd.@sd_port@.pid
+Type=simple
+User=bacula
+Group=tape
+Environment="CONFIG=/etc/bacula/bacula-sd.conf"
+EnvironmentFile=-/etc/default/bacula-sd
+ExecStartPre=@sbindir@/bacula-sd -t -c $CONFIG
+ExecStart=@sbindir@/bacula-sd -f -c $CONFIG
+ExecReload=/bin/kill -HUP $MAINPID
+SuccessExitStatus=15
 StandardError=syslog
 #LimitMEMLOCK=infinity
 TimeoutStopSec=3min