Skip to content

Commit

Permalink
net-mgmt/icingaweb2-module-director: Enable Icinga Director Backgroun…
Browse files Browse the repository at this point in the history
…d Daemon

Deploys in the director don't work/finish since the last update. The
reason is, that the update didn't enable the Icinga Director Background
Daemon, that has been mandatory since 1.7.0, see
https://github.com/Icinga/icingaweb2-module-director/blob/master/doc/75-Background-Daemon.md

PR: 269227
Reported by: flo
Sponsored by: Netzkommune GmbH
  • Loading branch information
joneum committed Feb 6, 2023
1 parent 9e56d30 commit 446cd08
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 4 deletions.
2 changes: 1 addition & 1 deletion GIDs
Expand Up @@ -258,7 +258,7 @@ promscale:*:314:
lavinmq:*:315:
nut:*:316:
hedgedoc:*:317:
# free: 318
# free: 318, UID used by icingadirector
# free: 319
# free: 320
# free: 321
Expand Down
2 changes: 1 addition & 1 deletion UIDs
Expand Up @@ -263,7 +263,7 @@ promscale:*:314:314::0:0:Promscale:/nonexistent:/usr/sbin/nologin
lavinmq:*:315:315::0:0:LavinMQ user:/nonexistent:/usr/sbin/nologin
nut:*:316:316::0:0:Network UPS Tools user:/nonexistent:/usr/sbin/nologin
hedgedoc:*:317:317::0:0:HedgeDoc user:/nonexistent:/usr/sbin/nologin
# free: 318
icingadirector:*:318:183::0:0:icingadirector user:/nonexistent:/usr/sbin/nologin
# free: 319
# free: 320
# free: 321
Expand Down
18 changes: 16 additions & 2 deletions net-mgmt/icingaweb2-module-director/Makefile
Expand Up @@ -15,21 +15,35 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= icingaweb2${PHP_PKGNAMESUFFIX}>=2.11.4:net-mgmt/icingaweb2@${PHP_FLAVOR}

USES= php:web,flavors
USE_PHP= pcntl
USE_RC_SUBR= icinga-director

DIRECTOR_USER?= icingadirector
DIRECTOR_GROUP?= icinga

USERS= ${DIRECTOR_USER}
GROUPS= ${DIRECTOR_GROUP}

SUB_LIST+= DIRECTOR_GROUP=${DIRECTOR_GROUP} \
DIRECTOR_USER=${DIRECTOR_USER}
PLIST_SUB+= DIRECTOR_GROUP=${DIRECTOR_GROUP} \
DIRECTOR_USER=${DIRECTOR_USER}

USE_GITHUB= yes
GH_ACCOUNT= icinga

NO_BUILD= yes
NO_ARCH= yes

OPTIONS_DEFINE= NLS
OPTIONS_DEFINE= NLS

NLS_USES= gettext
NLS_USE= php=intl
NLS_USE= PHP=intl

WWWDIR?= ${PREFIX}/www/icingaweb2/modules/${PORTNAME:C/^.*-//}

do-install:
@${MKDIR} ${STAGEDIR}/var/run/icinga-director
@${MKDIR} ${STAGEDIR}${WWWDIR}
(cd ${WRKSRC} && \
${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR})
Expand Down
29 changes: 29 additions & 0 deletions net-mgmt/icingaweb2-module-director/files/icinga-director.in
@@ -0,0 +1,29 @@
#!/bin/sh

# PROVIDE: icinga_director
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# icinga_director_enable (bool): Set to NO by default.
# Set it to YES to enable icinga_director.
# icinga_director_user: The user account used to run the daemon.
# Default: %%DIRECTOR_USER%%

. /etc/rc.subr

name=icinga_director
rcvar=icinga_director_enable

load_rc_config $name

: ${icinga_director_enable:="NO"}
: ${icinga_director_user:="%%DIRECTOR_USER%%"}

pidfile=/var/run/icinga-director/${name}.pid
command=/usr/sbin/daemon
command_args="-c -f -P $pidfile %%PREFIX%%/bin/icingacli director daemon run"

run_rc_command "$1"
1 change: 1 addition & 0 deletions net-mgmt/icingaweb2-module-director/pkg-plist
Expand Up @@ -1129,3 +1129,4 @@
%%WWWDIR%%/test/phpunit-compat.php
%%WWWDIR%%/test/setup_vendor.sh
%%WWWDIR%%/test/travis-prepare.sh
@dir(%%DIRECTOR_USER%%,DIRECTOR_GROUP%%,0775) /var/run/icinga-director

0 comments on commit 446cd08

Please sign in to comment.