mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-06 13:57:14 +02:00
community/bareos: fix APKBUILD and init-scripts
- remove unneeded scripts - fix permissions for config-dirs, scripts and binaries - fix init-scripts to run with non-root user
This commit is contained in:
parent
b32c9583cb
commit
c6464a23fc
@ -35,13 +35,15 @@ build() {
|
|||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--sysconfdir=/etc \
|
--sysconfdir=/etc \
|
||||||
--localstatedir=/var \
|
--localstatedir=/var \
|
||||||
|
--with-basename=$pkgname \
|
||||||
|
--with-hostname=localhost \
|
||||||
--with-confdir=/etc/$pkgname \
|
--with-confdir=/etc/$pkgname \
|
||||||
--with-archivedir=/var/lib/$pkgname/archive \
|
--with-archivedir=/var/lib/$pkgname/archive \
|
||||||
--with-scriptdir=/etc/$pkgname/scripts \
|
--with-scriptdir=/etc/$pkgname/scripts \
|
||||||
--with-working-dir=/var/lib/$pkgname \
|
--with-working-dir=/var/lib/$pkgname \
|
||||||
--with-plugindir=/usr/lib/$pkgname \
|
--with-plugindir=/usr/lib/$pkgname \
|
||||||
--with-backenddir=/usr/lib/$pkgname \
|
--with-backenddir=/usr/lib/$pkgname \
|
||||||
--with-pid-dir=/run \
|
--with-pid-dir=/run/$pkgname \
|
||||||
--with-logdir=/var/log/$pkgname \
|
--with-logdir=/var/log/$pkgname \
|
||||||
--with-subsys-dir=/var/lock \
|
--with-subsys-dir=/var/lock \
|
||||||
--enable-bat \
|
--enable-bat \
|
||||||
@ -73,7 +75,7 @@ build() {
|
|||||||
--with-sd-user=$pkgname \
|
--with-sd-user=$pkgname \
|
||||||
--with-sd-group=$pkgname \
|
--with-sd-group=$pkgname \
|
||||||
--with-fd-user=root \
|
--with-fd-user=root \
|
||||||
--with-fd-group=root
|
--with-fd-group=$pkgname
|
||||||
make
|
make
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,11 +91,29 @@ package() {
|
|||||||
# Install logrotate script
|
# Install logrotate script
|
||||||
install -Dm644 scripts/logrotate "$pkgdir"/etc/logrotate.d/$pkgname
|
install -Dm644 scripts/logrotate "$pkgdir"/etc/logrotate.d/$pkgname
|
||||||
|
|
||||||
local dir; for dir in /var/lib/$pkgname /var/lib/$pkgname/archive \
|
# Fix job to use shell script instead of perl script
|
||||||
/etc/$pkgname/scripts/make_catalog_backup* \
|
sed -i -e 's/make_catalog_backup.pl/make_catalog_backup/' \
|
||||||
/etc/$pkgname/scripts/mtx-changer*; do
|
"$pkgdir"/etc/bareos/bareos-dir.d/job/BackupCatalog.conf
|
||||||
chown $pkgname:$pkgname "$pkgdir"/$dir || return 1
|
|
||||||
done
|
# Remove unneeded scripts
|
||||||
|
rm "$pkgdir"/usr/sbin/bareos \
|
||||||
|
"$pkgdir"/usr/sbin/bconsole "$pkgdir"/usr/sbin/bregex \
|
||||||
|
"$pkgdir"/usr/sbin/bsmtp "$pkgdir"/usr/sbin/bwild \
|
||||||
|
"$pkgdir"/etc/$pkgname/scripts/bareos \
|
||||||
|
"$pkgdir"/etc/$pkgname/scripts/bconsole \
|
||||||
|
"$pkgdir"/etc/$pkgname/scripts/btraceback* \
|
||||||
|
"$pkgdir"/etc/$pkgname/scripts/bareos-ctl-* \
|
||||||
|
"$pkgdir"/etc/$pkgname/scripts/bareos_config \
|
||||||
|
"$pkgdir"/etc/$pkgname/scripts/make_catalog_backup.pl
|
||||||
|
|
||||||
|
# Fix premissions
|
||||||
|
chown :$pkgname "$pkgdir"/etc/$pkgname/scripts/* \
|
||||||
|
"$pkgdir"/etc/$pkgname/*.conf \
|
||||||
|
"$pkgdir"/usr/sbin/* \
|
||||||
|
"$pkgdir"/usr/bin/*
|
||||||
|
chown $pkgname:$pkgname -R "$pkgdir"/etc/$pkgname/bareos-*.d \
|
||||||
|
"$pkgdir"/var/lib/$pkgname \
|
||||||
|
"$pkgdir"/var/log/$pkgname
|
||||||
}
|
}
|
||||||
|
|
||||||
bat() {
|
bat() {
|
||||||
@ -110,6 +130,8 @@ bat() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
trayicon() {
|
trayicon() {
|
||||||
|
local dir
|
||||||
|
provides="$pkgname-tray-monitor"
|
||||||
depends="$pkgname"
|
depends="$pkgname"
|
||||||
pkgdesc="$pkgdesc (qt tray monitor)"
|
pkgdesc="$pkgdesc (qt tray monitor)"
|
||||||
mkdir -p "$subpkgdir"/etc/$pkgname "$subpkgdir"/usr/bin
|
mkdir -p "$subpkgdir"/etc/$pkgname "$subpkgdir"/usr/bin
|
||||||
@ -117,6 +139,11 @@ trayicon() {
|
|||||||
mv "$pkgdir"/etc/xdg "$subpkgdir"/etc
|
mv "$pkgdir"/etc/xdg "$subpkgdir"/etc
|
||||||
mv "$pkgdir"/etc/$pkgname/tray-monitor.d "$subpkgdir"/etc/$pkgname
|
mv "$pkgdir"/etc/$pkgname/tray-monitor.d "$subpkgdir"/etc/$pkgname
|
||||||
mv "$pkgdir"/usr/bin/bareos-tray-monitor "$subpkgdir"/usr/bin
|
mv "$pkgdir"/usr/bin/bareos-tray-monitor "$subpkgdir"/usr/bin
|
||||||
|
for dir in bareos-dir.d/console bareos-fd.d/director bareos-sd.d/director; do
|
||||||
|
mkdir -p "$subpkgdir"/etc/$pkgname/$dir
|
||||||
|
mv "$pkgdir"/etc/$pkgname/$dir/bareos-mon.conf \
|
||||||
|
"$subpkgdir"/etc/$pkgname/$dir
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
sha512sums="f379fd1d568260b1ad3c426b7b80b1d33a1b078db1aa03b847a4e1dc262cf0155419f20f7105bc095167bb5e64169d5e6b0bcfa3e3913d5e4b5f8f23f4fde750 bareos-16.2.6.tar.gz
|
sha512sums="f379fd1d568260b1ad3c426b7b80b1d33a1b078db1aa03b847a4e1dc262cf0155419f20f7105bc095167bb5e64169d5e6b0bcfa3e3913d5e4b5f8f23f4fde750 bareos-16.2.6.tar.gz
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
name="Bareos Director"
|
name="Bareos Director daemon"
|
||||||
|
pidfile=/run/bareos/bareos-dir.9101.pid
|
||||||
command=/usr/sbin/bareos-dir
|
command=/usr/sbin/bareos-dir
|
||||||
pidfile=/run/$RC_SVCNAME.pid
|
command_args="-u bareos -g bareos"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
need net
|
need net
|
||||||
after firewall
|
after firewall
|
||||||
use dns bareos-fd bareos-sd postgresql mariadb
|
use dns bareos-fd bareos-sd postgresql mariadb
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
checkpath -dm750 -o bareos "${pidfile%/*}"
|
||||||
|
}
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
name="Bareos File"
|
name="Bareos File daemon"
|
||||||
|
pidfile=/run/bareos/bareos-fd.9102.pid
|
||||||
command=/usr/sbin/bareos-fd
|
command=/usr/sbin/bareos-fd
|
||||||
pidfile=/run/$RC_SVCNAME.pid
|
command_args="-u root -g bareos"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
need net
|
need net
|
||||||
use dns
|
use dns
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
checkpath -dm750 -o bareos "${pidfile%/*}"
|
||||||
|
}
|
@ -1,10 +1,15 @@
|
|||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
name="Bareos Storage"
|
name="Bareos Storage daemon"
|
||||||
|
pidfile=/run/bareos/bareos-sd.9103.pid
|
||||||
command=/usr/sbin/bareos-sd
|
command=/usr/sbin/bareos-sd
|
||||||
pidfile=/run/$RC_SVCNAME.pid
|
command_args="-u bareos -g bareos"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
need net
|
need net
|
||||||
use dns
|
use dns
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
checkpath -dm750 -o bareos "${pidfile%/*}"
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user