-# This file is part of package Bacula Storage Daemon
+# Systemd Bacula service file
+#
+# Copyright (C) 2000-2016 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+# /lib/systemd/system/bacula-sd.service
#
-# 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
+# enable : systemctl enable bacula-sd
+# start : systemctl start bacula-sd
#
-# Bacula Storage Daemon service
#
+
+# from http://www.freedesktop.org/software/systemd/man/systemd.unit.html
[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=
+Requires=network.target
+After=network.target
+RequiresMountsFor=@working_dir@ @sysconfdir@ @sbindir@ @piddir@
+# 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
-# EnvironmentFile=-/etc/sysconfig/bacula-sd
-StandardOutput=syslog
-ExecStart=@sbindir@/bacula-sd -u @sd_user@ -g @sd_group@ -c @sysconfdir@/bacula-sd.conf
+StandardError=syslog
+#LimitMEMLOCK=infinity
+TimeoutStopSec=3min
[Install]
WantedBy=multi-user.target