[packages/bacula] systemd unit files added
jajcus
jajcus at pld-linux.org
Sun Nov 11 16:44:01 CET 2012
commit b6e1a6b680db594334c6b5bcac74c6772fcadb9b
Author: Jacek Konieczny <jajcus at jajcus.net>
Date: Sun Nov 11 15:49:56 2012 +0100
systemd unit files added
bacula-dir.service | 15 +++++++++++++++
bacula-fd.service | 15 +++++++++++++++
bacula-sd.service | 14 ++++++++++++++
bacula.spec | 35 +++++++++++++++++++++++++++++++----
4 files changed, 75 insertions(+), 4 deletions(-)
---
diff --git a/bacula.spec b/bacula.spec
index c4c7e19..601fb0c 100644
--- a/bacula.spec
+++ b/bacula.spec
@@ -43,6 +43,9 @@ Source13: %{name}.logrotate
Source14: %{name}-dir.sysconfig
Source15: %{name}-fd.sysconfig
Source16: %{name}-sd.sysconfig
+Source17: %{name}-dir.service
+Source18: %{name}-fd.service
+Source19: %{name}-sd.service
Patch0: %{name}-mtx-changer.patch
Patch1: %{name}-branding.patch
Patch2: %{name}-conf.patch
@@ -79,9 +82,10 @@ BuildRequires: qt4-qmake >= %{qtver}
BuildRequires: readline-devel
BuildRequires: rpm >= 4.4.9-56
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: rpmbuild(macros) >= 1.644
BuildRequires: sed >= 4.0
%{?with_sqlite3:BuildRequires: sqlite3-devel}
+Requires: systemd-units >= 38
BuildRequires: which
%if %{with console_wx}
BuildRequires: wxGTK2-unicode-devel >= 2.4.0
@@ -525,9 +529,11 @@ fakeroot %{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
-install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
+install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig} \
+ $RPM_BUILD_ROOT%{_sysconfdir}/rescue \
+ $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
+ $RPM_BUILD_ROOT{%{_mandir},%{_bindir},/var/log/bacula} \
+ $RPM_BUILD_ROOT%{systemdunitdir}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
@@ -555,6 +561,9 @@ cp -a %{SOURCE13} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-dir
cp -a %{SOURCE14} $RPM_BUILD_ROOT/etc/sysconfig/bacula-dir
cp -a %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/bacula-fd
cp -a %{SOURCE16} $RPM_BUILD_ROOT/etc/sysconfig/bacula-sd
+cp -a %{SOURCE17} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-dir.service
+cp -a %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-fd.service
+cp -a %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/bacula-sd.service
%if %{with console_wx}
# tray-monitor is for regular users
@@ -687,34 +696,49 @@ EOF
%update_configs
/sbin/chkconfig --add bacula-dir
%service bacula-dir restart "Bacula Director daemon"
+%systemd_post bacula-dir.service
%preun dir
if [ "$1" = "0" ]; then
%service bacula-dir stop
/sbin/chkconfig --del bacula-dir
fi
+%systemd_preun bacula-dir.service
+
+%postun dir
+%systemd_reload
%post fd
%update_configs
/sbin/chkconfig --add bacula-fd
%service bacula-fd restart "Bacula File daemon"
+%systemd_post bacula-fd.service
%preun fd
if [ "$1" = "0" ]; then
%service bacula-fd stop
/sbin/chkconfig --del bacula-fd
fi
+%systemd_preun bacula-fd.service
+
+%postun fd
+%systemd_reload
%post sd
%update_configs
/sbin/chkconfig --add bacula-sd
%service bacula-sd restart "Bacula Storage daemon"
+%systemd_post bacula-sd.service
%preun sd
if [ "$1" = "0" ]; then
%service bacula-sd stop
/sbin/chkconfig --del bacula-sd
fi
+%systemd_preun bacula-sd.service
+
+%postun sd
+%systemd_reload
%pre console
if [ -e %{_sysconfdir}/console.conf -a ! -e %{_sysconfdir}/bconsole.conf ]; then
@@ -817,6 +841,7 @@ ln -sf libbaccats-%{1}-%{version}.so %{_libdir}/libbaccats-%{version}.so || : \
%attr(640,root,root) %config(noreplace) /etc/logrotate.d/bacula-dir
%attr(754,root,root) /etc/rc.d/init.d/bacula-dir
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-dir
+%{systemdunitdir}/bacula-dir.service
%attr(755,root,root) %{_sbindir}/bacula-dir
%attr(755,root,root) %{_sbindir}/bregex
%attr(755,root,root) %{_sbindir}/bwild
@@ -894,6 +919,7 @@ ln -sf libbaccats-%{1}-%{version}.so %{_libdir}/libbaccats-%{version}.so || : \
%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bacula-fd.conf
%attr(754,root,root) /etc/rc.d/init.d/bacula-fd
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-fd
+%{systemdunitdir}/bacula-fd.service
%attr(755,root,root) %{_sbindir}/bacula-fd
%attr(755,root,root) %{_libdir}/bpipe-fd.so
%{_mandir}/man8/bacula-fd.8*
@@ -905,6 +931,7 @@ ln -sf libbaccats-%{1}-%{version}.so %{_libdir}/libbaccats-%{version}.so || : \
%attr(640,root,bacula) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mtx-changer.conf
%attr(754,root,root) /etc/rc.d/init.d/bacula-sd
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bacula-sd
+%{systemdunitdir}/bacula-sd.service
%attr(755,root,root) %{_sbindir}/bacula-sd
%attr(755,root,root) %{_sbindir}/bcopy
%attr(755,root,root) %{_sbindir}/bextract
diff --git a/bacula-dir.service b/bacula-dir.service
new file mode 100644
index 0000000..2451b4b
--- /dev/null
+++ b/bacula-dir.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Bacula Storage Daemon
+After=syslog.target network.target bacula-fd.service bacula-sd.service
+
+[Service]
+Environment=BACULA_DIR_USER=bacula
+Environment=BACULA_DIR_GROUP=bacula
+EnvironmentFile=-/etc/sysconfig/bacula-dir
+ExecStartPre=/usr/sbin/bacula-dir -t -c /etc/bacula/bacula-dir.conf -u ${BACULA_DIR_USER} -g ${BACULA_DIR_GROUP}
+ExecStart=/usr/sbin/bacula-dir -f -c /etc/bacula/bacula-dir.conf -u ${BACULA_DIR_USER} -g ${BACULA_DIR_GROUP} $BACULA_DIR_OPTIONS
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/bacula-fd.service b/bacula-fd.service
new file mode 100644
index 0000000..0d37f83
--- /dev/null
+++ b/bacula-fd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Bacula File Daemon
+After=syslog.target network.target local-fs.target
+
+[Service]
+Environment=BACULA_FD_USER=bacula
+Environment=BACULA_FD_GROUP=bacula
+EnvironmentFile=-/etc/sysconfig/bacula-fd
+ExecStartPre=/usr/sbin/bacula-fd -t -c /etc/bacula/bacula-fd.conf -u ${BACULA_FD_USER} -g ${BACULA_FD_GROUP}
+ExecStart=/usr/sbin/bacula-fd -f -c /etc/bacula/bacula-fd.conf -u ${BACULA_FD_USER} -g ${BACULA_FD_GROUP} $BACULA_FD_OPTIONS
+IOSchedulingClass=idle
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/bacula-sd.service b/bacula-sd.service
new file mode 100644
index 0000000..3cf64c5
--- /dev/null
+++ b/bacula-sd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Bacula Storage Daemon
+After=syslog.target network.target
+
+[Service]
+Environment=BACULA_SD_USER=bacula
+Environment=BACULA_SD_GROUP=bacula
+EnvironmentFile=-/etc/sysconfig/bacula-sd
+ExecStartPre=/usr/sbin/bacula-sd -t -c /etc/bacula/bacula-sd.conf -u ${BACULA_SD_USER} -g ${BACULA_SD_GROUP}
+ExecStart=/usr/sbin/bacula-sd -f -c /etc/bacula/bacula-sd.conf -u ${BACULA_SD_USER} -g ${BACULA_SD_GROUP} $BACULA_SD_OPTIONS
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/bacula.git/commitdiff/b6e1a6b680db594334c6b5bcac74c6772fcadb9b
More information about the pld-cvs-commit
mailing list