From: Julien Charbon Date: Mon, 7 Dec 2015 13:26:43 +0000 Subject: [PATCH] [VRSNBSD-192]: Create birdvty group at installation time and use it at launch time. --- net/bird/files/bird.in | 3 ++- net/bird/files/bird6.in | 3 ++- net/bird/pkg-install | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 net/bird/pkg-install diff --git a/net/bird/files/bird.in b/net/bird/files/bird.in index 9b6bf8f9189..62b1034c635 100644 --- a/net/bird/files/bird.in +++ b/net/bird/files/bird.in @@ -28,7 +28,8 @@ extra_commands="reload" : ${bird_enable="NO"} : ${bird_config="%%PREFIX%%/etc/bird.conf"} +: ${bird_group="birdvty"} -command_args="-P /var/run/${name}.pid -c $bird_config" +command_args="-P /var/run/${name}.pid -c $bird_config -g $bird_group" run_rc_command "$1" diff --git a/net/bird/files/bird6.in b/net/bird/files/bird6.in index 2a19e4a526d..776f3495c5e 100644 --- a/net/bird/files/bird6.in +++ b/net/bird/files/bird6.in @@ -28,7 +28,8 @@ extra_commands="reload" : ${bird6_enable="NO"} : ${bird6_config="%%PREFIX%%/etc/bird6.conf"} +: ${bird6_group="birdvty"} -command_args="-P /var/run/${name}.pid -c $bird6_config" +command_args="-P /var/run/${name}.pid -c $bird6_config -g $bird6_group" run_rc_command "$1" diff --git a/net/bird/pkg-install b/net/bird/pkg-install new file mode 100644 index 00000000000..104fef2f722 --- /dev/null +++ b/net/bird/pkg-install @@ -0,0 +1,16 @@ +#!/bin/sh + +VTY_GROUP=birdvty +VTY_GROUP_GID=502 + +case $2 in + POST-INSTALL) + echo "===> Creating users and/or groups." + if ! /usr/sbin/pw groupshow ${VTY_GROUP} >/dev/null 2>&1; then + echo "Creating group ${VTY_GROUP} with gid ${VTY_GROUP_GID}." + /usr/sbin/pw groupadd ${VTY_GROUP} -g ${VTY_GROUP_GID}; + else + echo "Using existing group ${VTY_GROUP}." + fi + ;; +esac -- 2.18.0