[Bacula-users] systemd file for bacula-dir



Hello guys, hope you're doing good:

I'd recently installed bacula 7.4.0 on CentOS 7 x86_64. I don't have
much experience with systemd files but I'm learning through this
process.

I didn't find any bacula*.service files under /usr/lib/systemd/system
directory so I created these ones:

-----------------------------------------
bacula-fd.service (it works fine)
-----------------------------------------
[Unit]
Description=Bacula File Daemon service
Requires=network.target
After=network.target
RequiresMountsFor=/var/bacula/working /etc/bacula /usr/sbin /var/run/bacula

# from http://www.freedesktop.org/software/systemd/man/systemd.service.html
[Service]
Type=forking
User=root
Group=root
ExecStart=/usr/sbin/bacula-fd -c /etc/bacula/bacula-fd.conf
PIDFile=/var/run/bacula/bacula-fd.9102.pid
StandardError=syslog

[Install]
WantedBy=multi-user.target

------------------------------------------
bacula-sd.service (it works fine)
------------------------------------------
[Unit]
Description=Bacula Storage Daemon service
Requires=network.target
After=network.target
RequiresMountsFor=/var/bacula/working /etc/bacula /usr/sbin /var/run/bacula

# from http://www.freedesktop.org/software/systemd/man/systemd.service.html
[Service]
Type=forking
User=bacula
Group=bacula
ExecStart=/usr/sbin/bacula-sd -c /etc/bacula/bacula-sd.conf
PIDFile=/var/run/bacula/bacula-sd.9103.pid
StandardError=syslog

[Install]
WantedBy=multi-user.target


---------------------------------------------------
bacula-dir.service (can't make it work)
---------------------------------------------------
[Unit]
Description=Bacula Director Daemon service
Requires=network.target
After=network.target
RequiresMountsFor=/var/bacula/working /etc/bacula /usr/sbin /var/run/bacula

# From http://www.freedesktop.org/software/systemd/man/systemd.service.html
[Service]
Type=forking
#User=bacula
#Group=bacula
PermissionsStartOnly=yes
ExecStartPre=-/bin/mkdir /var/run/bacula
ExecStartPre=-/bin/chown bacula:bacula /var/run/bacula
ExecStart=/usr/sbin/bacula-dir -u bacula -g bacula -c
/etc/bacula/bacula-dir.conf
PIDFile=/var/run/bacula/bacula-dir.9910.pid
ExecReload=/bin/kill -HUP $MAINPID
StandardError=syslog

[Install]
WantedBy=multi-user.target

I first tried it with "User" and "Group" directives enabled using
"bacula" user, then I modified to run it as root but using "-u" and
"-g" options as shown above.

The problem I have is that bacula-dir seems to start fine for some
seconds by running:

# systemctl start bacula-dir

... which keeps my prompt waiting for a response, but after some time
the command fails and this appear on my logs:

Feb 21 22:08:13 storage systemd: bacula-dir.service start operation
timed out. Terminating.

Am I missing anything?

Thank you

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Bacula-users mailing list
Bacula-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/bacula-users



Privacy