Commit 396be1be authored by Leonardo Arena's avatar Leonardo Arena

main/bacula$: rewrite init scripts

parent a01e506e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org> # Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=bacula pkgname=bacula
pkgver=7.4.7 pkgver=7.4.7
pkgrel=2 pkgrel=3
pkgdesc="Enterprise ready, network based backup program" pkgdesc="Enterprise ready, network based backup program"
url="http://www.bacula.org" url="http://www.bacula.org"
arch="all" arch="all"
...@@ -17,12 +17,9 @@ pkgusers="bacula" ...@@ -17,12 +17,9 @@ pkgusers="bacula"
pkggroups="bacula" pkggroups="bacula"
somask="libbaccats-$pkgver.so" somask="libbaccats-$pkgver.so"
source="http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz source="http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz
bacula-dir-init bacula-dir.initd
bacula-dir-conf bacula-sd.initd
bacula-sd-init bacula-fd.initd
bacula-sd-conf
bacula-fd-init
bacula-fd-conf
bacula-7.4.0-path-mounted.patch bacula-7.4.0-path-mounted.patch
" "
options="!check" #no test suite provided options="!check" #no test suite provided
...@@ -78,10 +75,8 @@ package() { ...@@ -78,10 +75,8 @@ package() {
make DESTDIR="$pkgdir" install make DESTDIR="$pkgdir" install
local daemon; for daemon in dir sd fd; do local daemon; for daemon in dir sd fd; do
install -Dm755 "$srcdir"/$pkgname-${daemon}-init \ install -Dm755 "$srcdir"/$pkgname-${daemon}.initd \
"$pkgdir"/etc/init.d/$pkgname-${daemon} "$pkgdir"/etc/init.d/$pkgname-${daemon}
install -Dm644 "$srcdir"/$pkgname-${daemon}-conf \
"$pkgdir"/etc/conf.d/$pkgname-${daemon}
done done
install -Dm644 examples/sample-query.sql \ install -Dm644 examples/sample-query.sql \
...@@ -163,23 +158,18 @@ libs() { ...@@ -163,23 +158,18 @@ libs() {
client() { client() {
pkgdesc="Bacula client" pkgdesc="Bacula client"
mkdir -p "$subpkgdir"/usr/sbin \ mkdir -p "$subpkgdir"/usr/sbin \
"$subpkgdir"/etc/conf.d \
"$subpkgdir"/etc/init.d \ "$subpkgdir"/etc/init.d \
"$subpkgdir"/etc/$pkgname "$subpkgdir"/etc/$pkgname
for bin in $pkgname $pkgname-fd bconsole btraceback; do for bin in $pkgname $pkgname-fd bconsole btraceback; do
mv "$pkgdir"/usr/sbin/$bin "$subpkgdir"/usr/sbin mv "$pkgdir"/usr/sbin/$bin "$subpkgdir"/usr/sbin
done done
mv "$pkgdir"/etc/conf.d/$pkgname-fd "$subpkgdir"/etc/conf.d
mv "$pkgdir"/etc/init.d/$pkgname-fd "$subpkgdir"/etc/init.d mv "$pkgdir"/etc/init.d/$pkgname-fd "$subpkgdir"/etc/init.d
mv "$pkgdir"/etc/$pkgname/$pkgname-fd.conf "$subpkgdir"/etc/$pkgname/ mv "$pkgdir"/etc/$pkgname/$pkgname-fd.conf "$subpkgdir"/etc/$pkgname/
install -d -o $pkgname -g $pkgname "$subpkgdir"/$_bworkdir install -d -o $pkgname -g $pkgname "$subpkgdir"/$_bworkdir
} }
sha512sums="2dcffe3f02de8e7dedc11f58aeca58fb95486757579065564753376d3fab7699d7577c189d0d34f8490706d773cd6a95d42ef1f35facb95e6fff10dad085c0d0 bacula-7.4.7.tar.gz sha512sums="2dcffe3f02de8e7dedc11f58aeca58fb95486757579065564753376d3fab7699d7577c189d0d34f8490706d773cd6a95d42ef1f35facb95e6fff10dad085c0d0 bacula-7.4.7.tar.gz
852df12c6555ad65661345e15872ca75b99a9d3e5b9e6ed80d82021006c9716a04919dabe88ff672aa550ac0b00b31eaa2e739469557fc326e6bb4216e2308b9 bacula-dir-init 7e5e164d891896b11b9a4eb8cf7a3ffc8d20aef01296df998d64aba3f1ad82c9537aaa94ef18d4b4a60c794192a484ae5358fba7885a2dbc812bd45f551a7fdd bacula-dir.initd
e06e5f8821d4a9a3f40cc8f11feeb5004780b82e2ad5e645f69a0f8faff78d8a8c6e66b36e105619b2a78d6b2f294dedd0e00e9bbf568af201cf299387135fef bacula-dir-conf de86166300aae2a76764f2ba316d713960525e944f8cdb76ce53cda779d3d60d6e88663de2fe1a461018a258b9d35523ad7e1a6d4695566c1d183f224b4181fe bacula-sd.initd
ee8a9206d3e604f5ac81bc70bece97ec77dae87b463a6ff4d08fba9418bf37e99a30895f115b2e9fbba1ec5f92b5d9368fd155717fedae12792f255b02413208 bacula-sd-init bc573ef44e0b4729631190b3cd8b7209266cb31b2c37f874b75184a4044cd6a8bf6f42adbcb2c5e215690cbb1e8045c1c04700853d66b9706bef815543d1250a bacula-fd.initd
80f6cf74cc14e722747d92e6e7b073bdf32456d395c6b4b63daa1ddcaf75f3d76d1b9a0e8e2da512e8f82e4d59a4a93cc38117af91d974fe7db644516bdb9909 bacula-sd-conf
e4c09734ccf9e1ac197ac4684c8294dddae817cf764b168ce7357b2529d11314f948ed2807d501b3c7cd7725ba488981fe573d7b389fca7feedfa9c8a1cce6fa bacula-fd-init
ff312e8952b31de27f22b257d12b570e151794d985f854ff19bab34363ea974d7583edced6b125518da3ecfe2b2a229b732473958b10484d988fcc8a67a372cc bacula-fd-conf
2d3757236aacca421261a8866ff04b5b0151538e1462559bd1240119b1bece1d456acbba9fee86dbc6aaec7af2a52eb2c0b7490c5f371b7deb478731c74342ff bacula-7.4.0-path-mounted.patch" 2d3757236aacca421261a8866ff04b5b0151538e1462559bd1240119b1bece1d456acbba9fee86dbc6aaec7af2a52eb2c0b7490c5f371b7deb478731c74342ff bacula-7.4.0-path-mounted.patch"
# Config file for /etc/init.d/bacula-dir
# Options for the director daemon.
# The DIR can be run as a non-root user, however
# please ensure that this user has proper permissions to
# access your backup devices.
DIR_OPTIONS="-u bacula -g bacula -c /etc/bacula/bacula-dir.conf"
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/app-backup/bacula/files/3.0.3/bacula-dir-init,v 1.1 2009/11/08 17:14:46 wschlich Exp $
depend() {
need net
after firewall
use dns bacula-fd bacula-sd postgresql mariadb
}
start() {
ebegin "Starting bacula director"
start-stop-daemon --start --quiet --exec /usr/sbin/bacula-dir \
-- ${DIR_OPTIONS}
eend $?
}
stop() {
ebegin "Stopping bacula director"
start-stop-daemon --stop --quiet --pidfile /var/run/bacula/bacula-dir.*.pid
eend $?
}
#!/sbin/openrc-run
: ${port:=9101}
: ${conf:=/etc/bacula/bacula-dir.conf}
: ${exec_user:=bacula}
: ${exec_group:=bacula}
name="Bacula Director"
command="/usr/sbin/$RC_SVCNAME"
command_args="-u $exec_user -g $exec_group -c $conf"
pidfile="/var/run/bacula/$RC_SVCNAME.$port.pid"
depend() {
need net
use dns
}
start_pre() {
checkpath -d -m 0775 -o ${exec_user}:${exec_group} /var/run/bacula
}
# Config file for /etc/init.d/bacula-fd
# Options for the file daemon.
FD_OPTIONS="-u root -g bacula -c /etc/bacula/bacula-fd.conf"
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/app-backup/bacula/files/3.0.3/bacula-fd-init,v 1.1 2009/11/08 17:14:46 wschlich Exp $
depend() {
need net
use dns
}
start() {
ebegin "Starting bacula file daemon"
start-stop-daemon --start --quiet --exec /usr/sbin/bacula-fd \
-- ${FD_OPTIONS}
eend $?
}
stop() {
ebegin "Stopping bacula file daemon"
start-stop-daemon --stop --quiet --pidfile /var/run/bacula/bacula-fd.*.pid
eend $?
}
#!/sbin/openrc-run
: ${port:=9102}
: ${conf:=/etc/bacula/bacula-fd.conf}
: ${exec_user:=root}
: ${exec_group:=root}
name="Bacula File Daemon"
command="/usr/sbin/$RC_SVCNAME"
command_args="-u $exec_user -g $exec_group -c $conf"
pidfile="/var/run/bacula/$RC_SVCNAME.$port.pid"
depend() {
need net
use dns
}
start_pre() {
checkpath -d -m 0775 -o ${exec_user}:${exec_group} /var/run/bacula
}
# Config file for /etc/init.d/bacula-sd
# Options for the storage daemon.
# The SD can be run as a non-root user, however
# please ensure that this user has proper permissions to
# access your backup devices.
SD_OPTIONS="-u bacula -g bacula -c /etc/bacula/bacula-sd.conf"
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/app-backup/bacula/files/3.0.3/bacula-sd-init,v 1.1 2009/11/08 17:14:46 wschlich Exp $
depend() {
need net
use dns
}
start() {
ebegin "Starting bacula storage daemon"
start-stop-daemon --start --quiet --exec /usr/sbin/bacula-sd \
-- ${SD_OPTIONS}
eend $?
}
stop() {
ebegin "Stopping bacula storage daemon"
start-stop-daemon --stop --quiet --pidfile /var/run/bacula/bacula-sd.*.pid
eend $?
}
#!/sbin/openrc-run
: ${port:=9103}
: ${conf:=/etc/bacula/bacula-dir.conf}
: ${exec_user:=bacula}
: ${exec_group:=bacula}
name="Bacula Storage Daemon"
command="/usr/sbin/$RC_SVCNAME"
command_args="-u $exec_user -g $exec_group -c $conf"
pidfile="/var/run/bacula/$RC_SVCNAME.$port.pid"
depend() {
need net
use dns
}
start_pre() {
checkpath -d -m 0775 -o ${exec_user}:${exec_group} /var/run/bacula
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment