From f085b9e9077532f46ee4682dc69f6f224045fe9d Mon Sep 17 00:00:00 2001 From: Alexander Golovko Date: Thu, 6 Sep 2012 19:16:26 +0200 Subject: [PATCH] Delegate uid/gid changing to systemd. Fixes bug #1905 --- bacula/platforms/systemd/bacula-dir.service.in | 4 +++- bacula/platforms/systemd/bacula-fd.service.in | 4 +++- bacula/platforms/systemd/bacula-sd.service.in | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bacula/platforms/systemd/bacula-dir.service.in b/bacula/platforms/systemd/bacula-dir.service.in index 265e92b64c..9a82532e29 100644 --- a/bacula/platforms/systemd/bacula-dir.service.in +++ b/bacula/platforms/systemd/bacula-dir.service.in @@ -26,10 +26,12 @@ ConditionPathIsDirectory=@working_dir@ [Service] Type=forking +User=@dir_user@ +Group=@dir_group@ PIDFile=@piddir@/bacula-dir.@dir_port@.pid # EnvironmentFile=-/etc/sysconfig/bacula-dir StandardOutput=syslog -ExecStart=@sbindir@/bacula-dir -u @dir_user@ -g @dir_group@ -c @sysconfdir@/bacula-dir.conf +ExecStart=@sbindir@/bacula-dir -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 diff --git a/bacula/platforms/systemd/bacula-fd.service.in b/bacula/platforms/systemd/bacula-fd.service.in index 8463bbd287..3efb256628 100644 --- a/bacula/platforms/systemd/bacula-fd.service.in +++ b/bacula/platforms/systemd/bacula-fd.service.in @@ -21,9 +21,11 @@ After=var-run.mount nss-lookup.target network.target remote-fs.target syslog.tar [Service] Type=forking +User=@fd_user@ +Group=@fd_group@ PIDFile=@piddir@/bacula-fd.@fd_port@.pid StandardOutput=syslog -ExecStart=@sbindir@/bacula-fd -u @fd_user@ -g @fd_group@ -c @sysconfdir@/bacula-fd.conf +ExecStart=@sbindir@/bacula-fd -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 index ba78f7f806..2d4dc1a519 100644 --- a/bacula/platforms/systemd/bacula-sd.service.in +++ b/bacula/platforms/systemd/bacula-sd.service.in @@ -21,10 +21,12 @@ After=var-run.mount nss-lookup.target network.target remote-fs.target syslog.tar [Service] Type=forking +User=@sd_user@ +Group=@sd_group@ 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 +ExecStart=@sbindir@/bacula-sd -c @sysconfdir@/bacula-sd.conf [Install] WantedBy=multi-user.target -- 2.39.5