commit:     3dabba831c4f4ffe807b2731de0930f69facccec
Author:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 21 10:00:55 2021 +0000
Commit:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
CommitDate: Sat Aug 21 10:02:55 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3dabba83

app-backup/bareos: revbump for improved systemd units

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Marc Schiffbauer <mschiff <AT> gentoo.org>

 ...eos-18.2.10.ebuild => bareos-18.2.10-r1.ebuild} | 16 ++++---------
 ...eos-19.2.10.ebuild => bareos-19.2.10-r1.ebuild} | 16 ++++---------
 ...areos-20.0.2.ebuild => bareos-20.0.2-r1.ebuild} | 16 ++++---------
 app-backup/bareos/files/bareos-dir.service         | 27 +++++++++++++++++++++
 app-backup/bareos/files/bareos-fd.service          | 26 ++++++++++++++++++++
 app-backup/bareos/files/bareos-sd.service          | 28 ++++++++++++++++++++++
 6 files changed, 96 insertions(+), 33 deletions(-)

diff --git a/app-backup/bareos/bareos-18.2.10.ebuild 
b/app-backup/bareos/bareos-18.2.10-r1.ebuild
similarity index 96%
rename from app-backup/bareos/bareos-18.2.10.ebuild
rename to app-backup/bareos/bareos-18.2.10-r1.ebuild
index a707bd84416..996c4c35ce1 100644
--- a/app-backup/bareos/bareos-18.2.10.ebuild
+++ b/app-backup/bareos/bareos-18.2.10-r1.ebuild
@@ -200,8 +200,8 @@ src_install() {
        rm -f 
"${D}"/usr/libexec/bareos/{bareos,bareos-ctl-dir,bareos-ctl-fd,bareos-ctl-sd,startmysql,stopmysql}
        rm -f "${D}"/usr/sbin/bareos
 
-       # remove upstream init scripts
-       rm -f "${D}"/etc/init.d/bareos-*
+       # remove upstream init scripts and systemd units
+       rm -f "${D}"/etc/init.d/bareos-* 
"${D}"/lib/systemd/system/bareos-*.service
 
        # rename statically linked apps
        if use clientonly && use static ; then
@@ -247,9 +247,6 @@ src_install() {
 
        rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
        if use clientonly || ! use director; then
-               if use systemd; then
-                       rm -vf "${D}"/lib/systemd/system/bareos-dir.service
-               fi
                rm -vf "${D}"/usr/share/man/man8/bareos-dir.8*
                rm -vf "${D}"/usr/share/man/man8/bareos-dbcheck.8*
                rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
@@ -265,9 +262,6 @@ src_install() {
                rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
        fi
        if use clientonly || ! use storage-daemon; then
-               if use systemd; then
-                       rm -vf "${D}"/lib/systemd/system/bareos-sd.service
-               fi
                rm -vf "${D}"/usr/share/man/man8/bareos-sd.8*
                rm -vf "${D}"/usr/share/man/man8/bcopy.8*
                rm -vf "${D}"/usr/share/man/man8/bextract.8*
@@ -331,10 +325,10 @@ src_install() {
        # install systemd unit files
        if use systemd; then
                if ! use clientonly; then
-                       use director && systemd_dounit 
core/platforms/systemd/bareos-dir.service
-                       use storage-daemon && systemd_dounit 
core/platforms/systemd/bareos-sd.service
+                       use director && systemd_dounit 
"${FILESDIR}"/bareos-dir.service
+                       use storage-daemon && systemd_dounit 
"${FILESDIR}"/bareos-sd.service
                fi
-               systemd_dounit core/platforms/systemd/bareos-fd.service
+               systemd_dounit "${FILESDIR}"/bareos-fd.service
        fi
 
        # make sure the working directory exists

diff --git a/app-backup/bareos/bareos-19.2.10.ebuild 
b/app-backup/bareos/bareos-19.2.10-r1.ebuild
similarity index 95%
rename from app-backup/bareos/bareos-19.2.10.ebuild
rename to app-backup/bareos/bareos-19.2.10-r1.ebuild
index ee87d3e36f9..a9e76afe101 100644
--- a/app-backup/bareos/bareos-19.2.10.ebuild
+++ b/app-backup/bareos/bareos-19.2.10-r1.ebuild
@@ -189,8 +189,8 @@ src_install() {
        # remove timelimit to fix #778557
        rm -f "${D}"/usr/{,s}bin/timelimit
 
-       # remove upstream init scripts
-       rm -f "${D}"/etc/init.d/bareos-*
+       # remove upstream init scripts and systemd units
+       rm -f "${D}"/etc/init.d/bareos-* 
"${D}"/lib/systemd/system/bareos-*.service
 
        # rename statically linked apps
        if use clientonly && use static ; then
@@ -236,9 +236,6 @@ src_install() {
 
        rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
        if use clientonly || ! use director; then
-               if use systemd; then
-                       rm -vf "${D}"/lib/systemd/system/bareos-dir.service
-               fi
                rm -vf "${D}"/usr/share/man/man8/bareos-dir.8*
                rm -vf "${D}"/usr/share/man/man8/bareos-dbcheck.8*
                rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
@@ -254,9 +251,6 @@ src_install() {
                rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
        fi
        if use clientonly || ! use storage-daemon; then
-               if use systemd; then
-                       rm -vf "${D}"/lib/systemd/system/bareos-sd.service
-               fi
                rm -vf "${D}"/usr/share/man/man8/bareos-sd.8*
                rm -vf "${D}"/usr/share/man/man8/bcopy.8*
                rm -vf "${D}"/usr/share/man/man8/bextract.8*
@@ -320,10 +314,10 @@ src_install() {
        # install systemd unit files
        if use systemd; then
                if ! use clientonly; then
-                       use director && systemd_dounit 
core/platforms/systemd/bareos-dir.service
-                       use storage-daemon && systemd_dounit 
core/platforms/systemd/bareos-sd.service
+                       use director && systemd_dounit 
"${FILESDIR}"/bareos-dir.service
+                       use storage-daemon && systemd_dounit 
"${FILESDIR}"/bareos-sd.service
                fi
-               systemd_dounit core/platforms/systemd/bareos-fd.service
+               systemd_dounit "${FILESDIR}"/bareos-fd.service
        fi
 
        # make sure the working directory exists

diff --git a/app-backup/bareos/bareos-20.0.2.ebuild 
b/app-backup/bareos/bareos-20.0.2-r1.ebuild
similarity index 96%
rename from app-backup/bareos/bareos-20.0.2.ebuild
rename to app-backup/bareos/bareos-20.0.2-r1.ebuild
index 2b7f4265375..edf65d1c2d9 100644
--- a/app-backup/bareos/bareos-20.0.2.ebuild
+++ b/app-backup/bareos/bareos-20.0.2-r1.ebuild
@@ -191,8 +191,8 @@ src_install() {
        rm -f 
"${D}"/usr/libexec/bareos/{bareos,bareos-ctl-dir,bareos-ctl-fd,bareos-ctl-sd,startmysql,stopmysql}
        rm -f "${D}"/usr/sbin/bareos
 
-       # remove upstream init scripts
-       rm -f "${D}"/etc/init.d/bareos-*
+       # remove upstream init scripts and systemd units
+       rm -f "${D}"/etc/init.d/bareos-* 
"${D}"/lib/systemd/system/bareos-*.service
 
        # get rid of py2 stuff if USE=-vmware
        if ! use vmware; then
@@ -244,9 +244,6 @@ src_install() {
 
        rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
        if use clientonly || ! use director; then
-               if use systemd; then
-                       rm -vf "${D}"/lib/systemd/system/bareos-dir.service
-               fi
                rm -vf "${D}"/usr/share/man/man8/bareos-dir.8*
                rm -vf "${D}"/usr/share/man/man8/bareos-dbcheck.8*
                rm -vf "${D}"/usr/share/man/man1/bsmtp.1*
@@ -262,9 +259,6 @@ src_install() {
                rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
        fi
        if use clientonly || ! use storage-daemon; then
-               if use systemd; then
-                       rm -vf "${D}"/lib/systemd/system/bareos-sd.service
-               fi
                rm -vf "${D}"/usr/share/man/man8/bareos-sd.8*
                rm -vf "${D}"/usr/share/man/man8/bcopy.8*
                rm -vf "${D}"/usr/share/man/man8/bextract.8*
@@ -328,10 +322,10 @@ src_install() {
        # install systemd unit files
        if use systemd; then
                if ! use clientonly; then
-                       use director && systemd_dounit 
core/platforms/systemd/bareos-dir.service
-                       use storage-daemon && systemd_dounit 
core/platforms/systemd/bareos-sd.service
+                       use director && systemd_dounit 
"${FILESDIR}"/bareos-dir.service
+                       use storage-daemon && systemd_dounit 
"${FILESDIR}"/bareos-sd.service
                fi
-               systemd_dounit core/platforms/systemd/bareos-fd.service
+               systemd_dounit "${FILESDIR}"/bareos-fd.service
        fi
 
        # make sure the working directory exists

diff --git a/app-backup/bareos/files/bareos-dir.service 
b/app-backup/bareos/files/bareos-dir.service
new file mode 100644
index 00000000000..a342671d0d0
--- /dev/null
+++ b/app-backup/bareos/files/bareos-dir.service
@@ -0,0 +1,27 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+#
+# Bareos Director Daemon
+#
+[Unit]
+Description=Bareos Director Daemon
+Documentation=man:bareos-dir(8)
+Requires=nss-lookup.target network.target remote-fs.target time-sync.target
+After=nss-lookup.target network.target remote-fs.target time-sync.target 
postgresql.service mysql.service mariadb.service
+ConditionPathIsDirectory=/var/lib/bareos
+
+[Service]
+Type=forking
+User=bareos
+Group=bareos
+WorkingDirectory=/var/lib/bareos
+PIDFile=/run/bareos/bareos-dir.9101.pid
+StandardError=journal
+ExecStartPre=/usr/sbin/bareos-dir -t -f
+ExecStart=/usr/sbin/bareos-dir
+SuccessExitStatus=0 1 15
+#Restart=on-failure
+
+[Install]
+Alias=bareos-director.service
+WantedBy=multi-user.target

diff --git a/app-backup/bareos/files/bareos-fd.service 
b/app-backup/bareos/files/bareos-fd.service
new file mode 100644
index 00000000000..e9b4b832afb
--- /dev/null
+++ b/app-backup/bareos/files/bareos-fd.service
@@ -0,0 +1,26 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+#
+# Bareos File Daemon
+#
+[Unit]
+Description=Bareos File Daemon
+Documentation=man:bareos-fd(8)
+Requires=nss-lookup.target network.target remote-fs.target time-sync.target
+After=nss-lookup.target network.target remote-fs.target time-sync.target
+
+[Service]
+Type=forking
+User=root
+Group=bareos
+WorkingDirectory=/var/lib/bareos
+PIDFile=/run/bareos/bareos-fd.9102.pid
+StandardError=journal
+ExecStartPre=/usr/sbin/bareos-fd -f -t
+ExecStart=/usr/sbin/bareos-fd
+SuccessExitStatus=0 15
+#Restart=on-failure
+
+[Install]
+Alias=bareos-filedaemon.service
+WantedBy=multi-user.target

diff --git a/app-backup/bareos/files/bareos-sd.service 
b/app-backup/bareos/files/bareos-sd.service
new file mode 100644
index 00000000000..80d9edbc973
--- /dev/null
+++ b/app-backup/bareos/files/bareos-sd.service
@@ -0,0 +1,28 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+#
+# Bareos Storage Daemon
+#
+[Unit]
+Description=Bareos Storage Daemon
+Documentation=man:bareos-sd(8)
+Requires=nss-lookup.target network.target remote-fs.target time-sync.target
+After=nss-lookup.target network.target remote-fs.target time-sync.target
+
+[Service]
+Type=forking
+User=root
+Group=bareos
+WorkingDirectory=/var/lib/bareos
+PIDFile=/run/bareos/bareos-sd.9103.pid
+StandardError=journal
+ExecStartPre=/usr/sbin/bareos-sd -t -f
+ExecStart=/usr/sbin/bareos-sd
+# enable this for scsicrypto-sd
+# CapabilityBoundingSet=cap_sys_rawio+ep
+SuccessExitStatus=0 15
+#Restart=on-failure
+
+[Install]
+Alias=bareos-storage.service
+WantedBy=multi-user.target

Reply via email to