Skip to content
Snippets Groups Projects
Commit a1c92ba9 authored by Francesco Colista's avatar Francesco Colista
Browse files

community/icingaweb2-module-director: added initd for director

Starting from 1.8.0, is mandatory that director daemon is started.
The init.d shipped by upstream works only with systemd, so we had
to write one for Alpine.

Created the icingadirector user, which starts the director, and
minor fixes related to permissions
parent 77026cdd
No related branches found
No related tags found
No related merge requests found
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=icingaweb2-module-director
_pkgname=icinga-director
_module=${pkgname/*-/}
pkgver=1.8.1
pkgrel=2
pkgrel=3
pkgdesc="Configuration frontend for Icinga 2, integrated automation"
url="http://www.icinga.org"
arch="noarch !armhf !armv7 !s390x !mips !mips64 !x86"
......@@ -11,9 +12,13 @@ license="GPL-2.0-or-later"
_php=php8
depends="icingaweb2 $_php-curl $_php-pcntl icingaweb2-module-incubator"
options="!check"
install="$pkgname.pre-install $pkgname.post-install"
pkgusers="icingadirector"
pkggroups="icingaweb2"
subpackages="$pkgname-doc"
source="icingaweb2-module-director-$pkgver.tar.gz::https://github.com/Icinga/icingaweb2-module-director/archive/v$pkgver.tar.gz"
subpackages="$pkgname-doc $_pkgname-openrc"
source="icingaweb2-module-director-$pkgver.tar.gz::https://github.com/Icinga/icingaweb2-module-director/archive/v$pkgver.tar.gz
$_pkgname.initd
$_pkgname.confd"
build() {
return 0
......@@ -33,6 +38,10 @@ package() {
cp -a doc "$pkgdir/usr/share/doc/$pkgname"
chgrp -R $pkggroups "$pkgdir/etc/icingaweb2/modules/$_module"
install -d -o $pkgusers -g $pkggroups -m 0750 "$pkgdir"/var/lib/icingadirector
install -Dm644 "$srcdir"/$_pkgname.confd "$pkgdir"/etc/conf.d/$_pkgname
install -Dm755 "$srcdir"/$_pkgname.initd "$pkgdir"/etc/init.d/$_pkgname
cat >"$pkgdir"/usr/share/doc/$pkgname/README.alpine <<EOF
You need to fix /etc/icingaweb2/modules/$_module with the owner of the user of your webserver
......@@ -48,8 +57,6 @@ For lighttpd:
# chown -R lighttpd /etc/icingaweb2/modules/$_module
Remember to enable the module with:
# icingacli module enable ipl
# icingacli module enable reactbundle
# icingacli module enable incubator
# icingacli module enable $_module
......@@ -57,6 +64,13 @@ EOF
}
openrc() {
default_openrc
depends="php8-cli php8-posix php8-iconv php8-sockets php8-curl php8-gettext"
}
sha512sums="
89fe35061deecd212576b6363289daa433c9664b95221c74a684a88e07ebd36d3b55b4a767f6caefeadb3679c5aa0787b1129f08b6d0fd698e5a2d5b17a3a2d1 icingaweb2-module-director-1.8.1.tar.gz
b3169954719c70e36dc9b103f7c00ece3bba5c91a4c5e732f2e740e5c696f0da82d42eee2cfbc41315db29eadcfb602c046875fb652fe45b6995eb28470871cb icinga-director.initd
097a7cb19aeb6346a97e2a032d0be4891371aee0042822da4a65ad91f095e91eb41dda04a63cdcabffee0ad44c415670955c6cf47cfcf0eeda2a914c8563069b icinga-director.confd
"
#ICINGA2_DIRECTOR_USER=
#ICINGAWEB2_GROUP=
#!/sbin/openrc-run
# (c) 2021 Francesco Colista <fcolista@alpinelinux.org>
name=$RC_SVCNAME
command="/usr/bin/icingacli"
command_args="director daemon run"
command_user="${ICINGA2_DIRECTOR_USER:-icingadirector}:${ICINGAWEB2_GROUP:-icingaweb2}"
supervisor="supervise-daemon"
#!/bin/sh
chgrp -R icingaweb2 /etc/icingaweb2/modules
/usr/share/webapps/icingaweb2/bin/icingacli setup config directory --group icingaweb2;
echo "Please take note of this setup token. This should be pasted into icingaweb2 setup web page: "
/usr/share/webapps/icingaweb2/bin/icingacli setup token create;
exit 0
#!/bin/sh
adduser -g icingaweb2 -D -h /var/lib/icingadirector -s /bin/false icingadirector 2>/dev/null
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment