diff --git a/GIDs b/GIDs index 23d9c2564c1bc..4b5cb168fbc5b 100644 --- a/GIDs +++ b/GIDs @@ -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 diff --git a/UIDs b/UIDs index b41b0f6ccb9cd..c2ecbb8c766bb 100644 --- a/UIDs +++ b/UIDs @@ -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 diff --git a/net-mgmt/icingaweb2-module-director/Makefile b/net-mgmt/icingaweb2-module-director/Makefile index 7ad9e7cf7cd1b..db0d3a986dbd6 100644 --- a/net-mgmt/icingaweb2-module-director/Makefile +++ b/net-mgmt/icingaweb2-module-director/Makefile @@ -15,6 +15,19 @@ 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 @@ -22,14 +35,15 @@ 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}) diff --git a/net-mgmt/icingaweb2-module-director/files/icinga-director.in b/net-mgmt/icingaweb2-module-director/files/icinga-director.in new file mode 100644 index 0000000000000..2f29fe26506ec --- /dev/null +++ b/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" diff --git a/net-mgmt/icingaweb2-module-director/pkg-plist b/net-mgmt/icingaweb2-module-director/pkg-plist index 0a5c0a5869d9f..f94b393259704 100644 --- a/net-mgmt/icingaweb2-module-director/pkg-plist +++ b/net-mgmt/icingaweb2-module-director/pkg-plist @@ -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