commit:     664fb6333ce395cd075283c7b975af3ae128d5d3
Author:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 18:02:40 2022 +0000
Commit:     Marc Schiffbauer <mschiff <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 18:09:58 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=664fb633

app-backup/bareos: add 20.0.8

Signed-off-by: Marc Schiffbauer <mschiff <AT> gentoo.org>

 app-backup/bareos/Manifest                         |   1 +
 app-backup/bareos/bareos-20.0.8.ebuild             | 393 +++++++++++++++++++++
 .../bareos/files/bareos-20.0.2-cmake-gentoo.patch  |  24 ++
 app-backup/bareos/files/bareos-dir.initd           |  30 +-
 app-backup/bareos/files/bareos-fd.initd            |  16 +-
 app-backup/bareos/files/bareos-sd.initd            |  30 +-
 app-backup/bareos/metadata.xml                     |   1 +
 7 files changed, 442 insertions(+), 53 deletions(-)

diff --git a/app-backup/bareos/Manifest b/app-backup/bareos/Manifest
index 0325b45696fd..e9d91ab26b15 100644
--- a/app-backup/bareos/Manifest
+++ b/app-backup/bareos/Manifest
@@ -1,2 +1,3 @@
+DIST bareos-20.0.8.tar.gz 13429247 BLAKE2B 
5576cf738fccad0ac39f7c92e8da01f4925d58e4373c8bc19f68ddb8cc8d6a07bf73dfd39bd2111766ccd20ce2da224680b8ab9adf7b84421874ae916e633f75
 SHA512 
1da30d0ff2f1fda2c4a41ec6d41ec60e3212b1bdb153c7f397931580894f31e36ab84f655d263aed47b9eb21e68ef7e59ec3b7bbd4f2c8981ae04b84733ffb68
 DIST bareos-21.1.2.tar.gz 11582588 BLAKE2B 
e7e02b3897d7e377cc79d9d0880da821f1b81d1f54891d89e704e78f51471cdf94b5a02ffe2f4ed54dec38bf37ccc757bf1641c3b678a04e401f48484ed3c941
 SHA512 
acdc787ff828add93c81b2b7d293dec90f2aa22aa3aee3002662bd30e88dc0dc58b753bb63ca7c111fac6c7eeea888938236c1169f92ed6cec27941036c7b6b1
 DIST bareos-21.1.5.tar.gz 11655244 BLAKE2B 
18ef42669cfdd7a663910fa1ce9b46f12eab0aa3a2106e9877dc3d341e9a7b309c21bc1768d4873d626938fcbb2084884a85d6dcef0aa2834b117aef1034d28f
 SHA512 
637c6c0500ff31bb2c87f27d87f908d49836191afb880de4b636432b9c20433ec6f32f5805aaa7fb57f2f99a0201c51802c8d213ee5573642698f74da4cb06b7

diff --git a/app-backup/bareos/bareos-20.0.8.ebuild 
b/app-backup/bareos/bareos-20.0.8.ebuild
new file mode 100644
index 000000000000..df9da51888cc
--- /dev/null
+++ b/app-backup/bareos/bareos-20.0.8.ebuild
@@ -0,0 +1,393 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+CMAKE_WARN_UNUSED_CLI=no
+#CMAKE_REMOVE_MODULES=yes
+
+inherit python-any-r1 systemd cmake tmpfiles
+
+DESCRIPTION="Featureful client/server network backup suite"
+HOMEPAGE="https://www.bareos.org/";
+SRC_URI="https://github.com/${PN}/${PN}/archive/Release/${PV}.tar.gz -> 
${P}.tar.gz"
+RESTRICT="mirror"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X acl ceph clientonly +director glusterfs ipv6 jansson lmdb
+       logwatch mysql ndmp +postgres readline scsi-crypto
+       sqlite static +storage-daemon systemd tcpd vim-syntax vmware xattr"
+
+# get cmake variables from core/cmake/BareosSetVariableDefaults.cmake
+DEPEND="
+       !app-backup/bacula
+       acct-group/${PN}
+       !x86? (
+               ceph? ( sys-cluster/ceph )
+       )
+       glusterfs? ( sys-cluster/glusterfs )
+       lmdb? ( dev-db/lmdb )
+       dev-libs/gmp:0
+       !clientonly? (
+               acct-user/${PN}
+               postgres? ( dev-db/postgresql:*[threads] )
+               mysql? ( virtual/mysql )
+               sqlite? ( dev-db/sqlite:3 )
+               director? (
+                       virtual/mta
+                       jansson? ( dev-libs/jansson:= )
+               )
+       )
+       logwatch? ( sys-apps/logwatch )
+       ndmp? ( net-libs/rpcsvc-proto )
+       tcpd? ( sys-apps/tcp-wrappers )
+       readline? ( sys-libs/readline:0 )
+       static? (
+               acl? ( virtual/acl[static-libs] )
+               sys-libs/zlib[static-libs]
+               dev-libs/lzo[static-libs]
+               sys-libs/ncurses:=[static-libs]
+               dev-libs/openssl:0=[static-libs]
+       )
+       !static? (
+               acl? ( virtual/acl )
+               dev-libs/lzo
+               dev-libs/openssl:0=
+               sys-libs/ncurses:=
+               sys-libs/zlib
+       )
+       "
+RDEPEND="${DEPEND}
+       !clientonly? (
+               storage-daemon? (
+                       sys-block/mtx
+                       app-arch/mt-st
+               )
+       )
+       vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
+       "
+BDEPEND="${PYTHON_DEPS}"
+
+REQUIRED_USE="
+       !clientonly? ( || ( mysql postgres sqlite ) )
+       static? ( clientonly )
+       x86? ( !ceph )
+"
+
+S=${WORKDIR}/${PN}-Release-${PV}
+
+src_prepare() {
+       use mysql    && export mydbtypes+=( mysql )
+       use postgres && export mydbtypes+=( postgresql )
+       use sqlite   && export mydbtypes+=( sqlite )
+
+       # enables default database driver in catalog
+       pushd core/src/defaultconfigs >&/dev/null || die
+               sed -i -e 's/#dbdriver/dbdriver/' -e 
'/XXX_REPLACE_WITH_DATABASE_DRIVER_XXX/d' $(grep -rl 
XXX_REPLACE_WITH_DATABASE_DRIVER_XXX) \
+                       || die "sed on MyCatalog.conf.in failed"
+       popd >&/dev/null || die
+
+       # fix gentoo platform support
+       eapply -p1 "${FILESDIR}/${PN}-20.0.2-cmake-gentoo.patch"
+
+       # fix missing DESTDIR in symlink creation
+       sed -i '/bareos-symlink-default-db-backend.cmake/d' 
"${S}/core/src/cats/CMakeLists.txt"
+
+       # disable dird and stored plugins, because of
+       # py2 dependency
+       cd "${S}/core/src/plugins"
+       cmake_comment_add_subdirectory dird
+       cmake_comment_add_subdirectory stored
+       cd -
+
+       CMAKE_USE_DIR="$S/core"
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=()
+
+       CMAKE_USE_DIR="$S/core"
+
+       pushd core/platforms >&/dev/null || die
+       cmake_comment_add_subdirectory '${DISTNAME}'
+       popd >&/dev/null || die
+
+       if use clientonly; then
+               mycmakeargs+=(
+                       -Dclient-only=ON
+                       -Dstatic-cons=$(usex static)
+                       -Dstatic-fd=$(usex static)
+               )
+       fi
+
+       for useflag in acl ipv6 ndmp scsi-crypto \
+               systemd mysql lmdb; do
+               mycmakeargs+=( -D$useflag=$(usex $useflag) )
+       done
+
+       mycmakeargs+=(
+               -DHAVE_PYTHON=0
+               -DDEFAULT_DB_TYPE=${mydbtypes[0]}
+               -Darchivedir=/var/lib/bareos/storage
+               -Dbackenddir=/usr/$(get_libdir)/${PN}/backend
+               -Dbasename="`hostname -s`"
+               -Dbatch-insert=yes
+               -Dbsrdir=/var/lib/bareos/bsr
+               -Dconfdir=/etc/bareos
+               -Dcoverage=no
+               -Ddb_password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 
16 | head -n 1`
+               -Ddir-group=bareos
+               -Ddir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold 
-w 32 | head -n 1`"
+               -Ddir-user=bareos
+               -Ddocdir=/usr/share/doc/${PF}
+               -Ddynamic-cats-backends=yes
+               -Ddynamic-storage-backends=yes
+               -Dfd-group=bareos
+               -Dfd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 
32 | head -n 1`"
+               -Dfd-user=root
+               -Dhost=${CHOST}
+               -Dhostname="`hostname -s`"
+               -Dhtmldir=/usr/share/doc/${PF}/html
+               -Dlibdir=/usr/$(get_libdir)
+               -Dlogdir=/var/log/bareos
+               -Dmandir=/usr/share/man
+               -Dmon-dir-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | 
fold -w 32 | head -n 1`"
+               -Dmon-fd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | 
fold -w 32 | head -n 1`"
+               -Dmon-sd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | 
fold -w 32 | head -n 1`"
+               -Dmysql=$(usex mysql)
+               -Dopenssl=yes
+               -Dpiddir=/run/bareos
+               -Dplugindir=/usr/$(get_libdir)/${PN}/plugin
+               -Dpostgresql=$(usex postgres)
+               -Dsbin-perm=0755
+               -Dsbindir=/usr/sbin
+               -Dscriptdir=/usr/libexec/bareos
+               -Dsd-group=bareos
+               -Dsd-password="`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 
32 | head -n 1`"
+               -Dsd-user=root
+               -Dsqlite3=$(usex sqlite)
+               -Dsubsysdir=/run/lock/subsys
+               -Dsysconfdir=/etc
+               -Dworkingdir=/var/lib/bareos
+               -Dx=$(usex X)
+               )
+
+               # disable droplet support for now as it does not build with gcc 
10
+               # ... and this is a bundled lib, which should have its own 
package
+               cd core && cmake_comment_add_subdirectory "src/droplet"
+
+               cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+
+       # remove some scripts we don't need at all
+       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 and systemd units
+       rm -f "${D}"/etc/init.d/bareos-* 
"${D}"/lib/systemd/system/bareos-*.service
+
+       # remove misc stuff we do not need in production
+       rm -f "${D}"/etc/bareos/bareos-regress.conf
+       rm -f "${D}"/etc/logrotate.d/bareos-dir
+
+       # get rid of py2 stuff
+       rm -rf "$D"/usr/lib64/python2.7
+       rm -f "$D"/usr/lib64/bareos/plugin/python-fd.so
+       if ! use vmware; then
+               rm -f 
"$D"/usr/lib64/bareos/plugin/{BareosFdPluginVMware.py,bareos-fd-vmware.py}
+       fi
+
+       # rename statically linked apps
+       if use clientonly && use static ; then
+               pushd "${D}"/usr/sbin || die
+               mv static-bareos-fd bareos-fd || die
+               mv static-bconsole bconsole || die
+               popd || die
+       fi
+
+       # extra files which 'make install' doesn't cover
+       if ! use clientonly; then
+               # the logrotate configuration
+               # (now unconditional wrt bug #258187)
+               diropts -m0755
+               insinto /etc/logrotate.d
+               insopts -m0644
+               newins "${S}"/core/scripts/logrotate bareos
+
+               # the logwatch scripts
+               if use logwatch; then
+                       diropts -m0750
+                       dodir /etc/log.d/scripts/services
+                       dodir /etc/log.d/scripts/shared
+                       dodir /etc/log.d/conf/logfiles
+                       dodir /etc/log.d/conf/services
+                       pushd "${S}"/core/scripts/logwatch >&/dev/null || die
+
+                       into /etc/log.d/scripts/services
+                       dobin bareos
+
+                       into /etc/log.d/scripts/shared
+                       dobin applybareosdate
+
+                       insinto /etc/log.d/conf/logfiles
+                       newins logfile.bareos.conf bareos.conf
+
+                       insinto /etc/log.d/conf/services
+                       newins services.bareos.conf bareos.conf
+
+                       popd >&/dev/null || die
+               fi
+       fi
+
+       rm -vf "${D}"/usr/share/man/man1/bareos-bwxconsole.1*
+       if use clientonly || ! use director; then
+               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*
+               rm -vf "${D}"/usr/share/man/man8/bwild.8*
+               rm -vf "${D}"/usr/share/man/man8/bregex.8*
+               rm -vf "${D}"/usr/share/man/man8/bpluginfo.8*
+               rm -vf "${D}"/usr/libexec/bareos/create_*_database
+               rm -vf "${D}"/usr/libexec/bareos/drop_*_database
+               rm -vf "${D}"/usr/libexec/bareos/make_*_tables
+               rm -vf "${D}"/usr/libexec/bareos/update_*_tables
+               rm -vf "${D}"/usr/libexec/bareos/drop_*_tables
+               rm -vf "${D}"/usr/libexec/bareos/grant_*_privileges
+               rm -vf "${D}"/usr/libexec/bareos/*_catalog_backup
+       fi
+       if use clientonly || ! use storage-daemon; then
+               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*
+               rm -vf "${D}"/usr/share/man/man8/bls.8*
+               rm -vf "${D}"/usr/share/man/man8/bscan.8*
+               rm -vf "${D}"/usr/share/man/man8/btape.8*
+               rm -vf "${D}"/usr/libexec/bareos/disk-changer
+               rm -vf "${D}"/usr/libexec/bareos/mtx-changer
+               rm -vf "${D}"/usr/libexec/bareos/dvd-handler
+               rm -vf "${D}"/etc/bareos/mtx-changer.conf
+       fi
+       if ! use scsi-crypto; then
+               rm -vf "${D}"/usr/share/man/man8/bscrypto.8*
+       fi
+
+       # documentation
+       dodoc README.md
+       dodoc core/README.configsubdirectories
+       use glusterfs dodoc core/README.glusterfs
+       use ndmp && dodoc core/README.NDMP
+       use scsi-crypto && dodoc core/README.scsicrypto
+
+       # vim-files
+       if use vim-syntax; then
+               insinto /usr/share/vim/vimfiles/syntax
+               doins core/scripts/bareos.vim
+               insinto /usr/share/vim/vimfiles/ftdetect
+               newins core/scripts/filetype.vim bareos_ft.vim
+       fi
+
+       # setup init scripts
+       myscripts="bareos-fd"
+       if ! use clientonly; then
+               if use director; then
+                       myscripts+=" bareos-dir"
+               fi
+               if use storage-daemon; then
+                       myscripts+=" bareos-sd"
+               fi
+       fi
+       for script in ${myscripts}; do
+               # copy over init script and config to a temporary location
+               # so we can modify them as needed
+               cp "${FILESDIR}/${script}".confd "${T}/${script}".confd || die 
"failed to copy ${script}.confd"
+               cp "${FILESDIR}/${script}".initd "${T}/${script}".initd || die 
"failed to copy ${script}.initd"
+
+               # now set the database dependency for the director init script
+               case "${script}" in
+                       bareos-dir)
+                               sed -i -e "s:%databasetypes%:${mydbtypes[*]}:" 
"${T}/${script}".confd || die
+                               ;;
+                       *)
+                               ;;
+               esac
+
+               # install init script and config
+               newinitd "${T}/${script}".initd "${script}"
+               newconfd "${T}/${script}".confd "${script}"
+       done
+
+       # install systemd unit files
+       if use systemd; then
+               if ! use clientonly; then
+                       use director && systemd_dounit 
"${FILESDIR}"/bareos-dir.service
+                       use storage-daemon && systemd_dounit 
"${FILESDIR}"/bareos-sd.service
+               fi
+               systemd_dounit "${FILESDIR}"/bareos-fd.service
+       fi
+
+       # make sure the working directory exists
+       diropts -m0750
+       keepdir /var/lib/bareos
+       keepdir /var/lib/bareos/storage
+
+       diropts -m0755 -o bareos -g bareos
+       keepdir /var/log/bareos
+
+       newtmpfiles "${FILESDIR}"/tmpfiles.d-bareos.conf bareos.conf
+
+       # make sure bareos group can execute bareos libexec scripts
+       fowners -R root:bareos /usr/libexec/bareos
+}
+
+pkg_postinst() {
+       tmpfiles_process bareos.conf
+
+       if use clientonly; then
+               fowners root:bareos /var/lib/bareos
+       else
+               fowners bareos:bareos /var/lib/bareos
+       fi
+
+       if ! use clientonly && use director; then
+               einfo
+               einfo "If this is a new install, you must create the database:"
+               if use postgres; then
+                       einfo
+                       einfo "For postgresql:"
+                       einfo "  su postgres -c 
'/usr/libexec/bareos/create_bareos_database postgresql'"
+                       einfo "  su postgres -c 
'/usr/libexec/bareos/make_bareos_tables postgresql'"
+                       einfo "  su postgres -c 
'/usr/libexec/bareos/grant_bareos_privileges postgresql'"
+               fi
+               if use mysql; then
+                       einfo
+                       einfo "For mysql:"
+                       einfo
+                       einfo "  Make sure root has direct access to your mysql 
server. You may want to"
+                       einfo "  create a /root/.my.cnf file with"
+                       einfo "    [client]"
+                       einfo "    user=root"
+                       einfo "    password=YourPasswordForAccessingMysqlAsRoot"
+                       einfo "  before running:"
+                       einfo "  /usr/libexec/bareos/create_bareos_database 
mysql"
+                       einfo "  /usr/libexec/bareos/make_bareos_tables mysql"
+                       einfo "  /usr/libexec/bareos/grant_bareos_privileges 
mysql"
+               fi
+               einfo
+       fi
+
+       if use sqlite; then
+               einfo
+               einfo "Be aware that Bareos does not officially support SQLite 
database."
+               einfo "Best use it only for a client-only installation. See Bug 
#445540."
+               einfo
+               einfo "It is strongly recommended to use either postgresql or 
mysql as"
+               einfo "catalog database backend."
+       fi
+}

diff --git a/app-backup/bareos/files/bareos-20.0.2-cmake-gentoo.patch 
b/app-backup/bareos/files/bareos-20.0.2-cmake-gentoo.patch
new file mode 100644
index 000000000000..9d3cf8092e1c
--- /dev/null
+++ b/app-backup/bareos/files/bareos-20.0.2-cmake-gentoo.patch
@@ -0,0 +1,24 @@
+diff -urw bareos-Release-20.0.2.orig/core/cmake/distname.sh 
bareos-Release-20.0.2/core/cmake/distname.sh
+--- bareos-Release-20.0.2.orig/core/cmake/distname.sh  2021-06-10 
06:07:18.000000000 -0930
++++ bareos-Release-20.0.2/core/cmake/distname.sh       2021-08-15 
17:07:37.168216517 -0930
+@@ -153,7 +153,7 @@
+       elif test -f /etc/gentoo-release
+       then
+          PLATFORM=gentoo
+-         DISTVER=`awk '/version / { print $5 }' < /etc/gentoo-release`
++         DISTVER=`awk '/release / { print $5 }' < /etc/gentoo-release`
+       elif test -f /etc/debian_version
+       then
+          if `test -f /etc/apt/sources.list && grep -q ubuntu 
/etc/apt/sources.list`; then
+diff -urw bareos-Release-20.0.2.orig/core/platforms/CMakeLists.txt 
bareos-Release-20.0.2/core/platforms/CMakeLists.txt
+--- bareos-Release-20.0.2.orig/core/platforms/CMakeLists.txt   2021-06-10 
06:07:18.000000000 -0930
++++ bareos-Release-20.0.2/core/platforms/CMakeLists.txt        2021-08-15 
17:07:37.549226558 -0930
+@@ -30,6 +30,8 @@
+     message(STATUS "adding subdirectories debian and univention")
+     add_subdirectory(debian)
+     add_subdirectory(univention)
++  elseif(${PLATFORM} STREQUAL gentoo)
++    message(STATUS "PLATFORM: " ${PLATFORM})
+   elseif(${PLATFORM} STREQUAL hpux)
+     message(STATUS "PLATFORM: " ${PLATFORM})
+   elseif(${PLATFORM} STREQUAL archlinux)

diff --git a/app-backup/bareos/files/bareos-dir.initd 
b/app-backup/bareos/files/bareos-dir.initd
index 462ff07843a2..0bb566582f4c 100644
--- a/app-backup/bareos/files/bareos-dir.initd
+++ b/app-backup/bareos/files/bareos-dir.initd
@@ -1,30 +1,20 @@
 #!/sbin/openrc-run
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 depend() {
        use dns bareos-fd bareos-sd
 }
 
-start() {
-       ebegin "Starting bareos director"
-       # g+w until #631598 is resolved
-       checkpath -d -m 0770 -o root:bareos /run/bareos
-       start-stop-daemon --start --quiet --exec /usr/sbin/bareos-dir \
-               -- ${DIR_OPTIONS}
-       # harden pid file until #631598 is resolved
-       ewaitfile 10 /run/bareos/bareos-dir.9101.pid
-       chown root:bareos /run/bareos/bareos-dir.9101.pid
-       eend $?
+start_pre() {
+       checkpath --directory --owner root:bareos --mode 01775 /run/bareos
 }
 
-stop() {
-       ebegin "Stopping bareos director"
-       # check pid file until #631598 is resolved
-       if [[ $(stat -c %U /run/bareos/bareos-dir.9101.pid) != "root" ]]; then
-               eerror "SECURITY ALERT: pid file is not root owned anymore?! 
(see #631598)"
-       else
-               start-stop-daemon --stop --quiet --pidfile 
/run/bareos/bareos-dir.9101.pid
-       fi
-       eend $?
+start_post() {
+       ewaitfile 10 /run/bareos/bareos-dir.9101.pid
+       checkpath --file --owner root:bareos /run/bareos/bareos-dir.9101.pid
 }
+
+command="/usr/sbin/bareos-dir"
+command_args="${DIR_OPTIONS}"
+pidfile="/run/bareos/bareos-dir.9101.pid"

diff --git a/app-backup/bareos/files/bareos-fd.initd 
b/app-backup/bareos/files/bareos-fd.initd
index e65e6c80f32b..31d9342c1f0e 100644
--- a/app-backup/bareos/files/bareos-fd.initd
+++ b/app-backup/bareos/files/bareos-fd.initd
@@ -6,16 +6,6 @@ depend() {
        use dns
 }
 
-start() {
-       ebegin "Starting bareos file daemon"
-       checkpath -d -m 0750 -o root:bareos /run/bareos
-       start-stop-daemon --start --quiet --exec /usr/sbin/bareos-fd \
-               -- ${FD_OPTIONS}
-       eend $?
-}
-
-stop() {
-       ebegin "Stopping bareos file daemon"
-       start-stop-daemon --stop --quiet --pidfile /run/bareos/bareos-fd.*.pid
-       eend $?
-}
+command="/usr/sbin/bareos-fd"
+command_args="${FD_OPTIONS}"
+pidfile="/run/bareos/bareos-fd.9102.pid"

diff --git a/app-backup/bareos/files/bareos-sd.initd 
b/app-backup/bareos/files/bareos-sd.initd
index 97b9ccdc92f1..222dc95f47d5 100644
--- a/app-backup/bareos/files/bareos-sd.initd
+++ b/app-backup/bareos/files/bareos-sd.initd
@@ -1,30 +1,20 @@
 #!/sbin/openrc-run
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 depend() {
        use dns
 }
 
-start() {
-       ebegin "Starting bareos storage daemon"
-       # g+w until #631598 is resolved
-       checkpath -d -m 0770 -o root:bareos /run/bareos
-       start-stop-daemon --start --quiet --exec /usr/sbin/bareos-sd \
-               -- ${SD_OPTIONS}
-       # harden pid file until #631598 is resolved
-       ewaitfile 10 /run/bareos/bareos-sd.9103.pid
-       chown root:bareos /run/bareos/bareos-sd.9103.pid
-       eend $?
+start_pre() {
+       checkpath --directory --owner root:bareos --mode 01775 /run/bareos
 }
 
-stop() {
-       ebegin "Stopping bareos storage daemon"
-       # check pid file until #631598 is resolved
-       if [[ $(stat -c %U /run/bareos/bareos-sd.9103.pid) != "root" ]]; then
-               eerror "SECURITY ALERT: pid file is not root owned anymore?! 
(see #631598)"
-       else
-               start-stop-daemon --stop --quiet --pidfile 
/run/bareos/bareos-sd.9103.pid
-       fi
-       eend $?
+start_post() {
+       ewaitfile 10 /run/bareos/bareos-sd.9103.pid
+       checkpath --file --owner root:bareos /run/bareos/bareos-sd.9103.pid
 }
+
+command="/usr/sbin/bareos-sd"
+command_args="${SD_OPTIONS}"
+pidfile="/run/bareos/bareos-sd.9103.pid"

diff --git a/app-backup/bareos/metadata.xml b/app-backup/bareos/metadata.xml
index b86860aeb86a..74fcd0331c3a 100644
--- a/app-backup/bareos/metadata.xml
+++ b/app-backup/bareos/metadata.xml
@@ -10,6 +10,7 @@
     <flag name="clientonly">Only install file-daemon (client)</flag>
     <flag name="director">Install director</flag>
     <flag name="glusterfs">Enable glusterfs storage backend</flag>
+    <flag name="jansson">JSON API support using JANSSON for director</flag>
     <flag name="lmdb">enable build of LMDB support for faster accurate 
backup</flag>
     <flag name="logwatch">Install support files for logwatch</flag>
     <flag name="ndmp">Enable support for NDMP (Network Data Management 
Protocol)</flag>

Reply via email to