Skip to content

Commit

Permalink
Changes to support -B options for tac_plus command line arguments.
Browse files Browse the repository at this point in the history
    * when tac_plus is run with -B arguments then the PID file
      name changes, and this needs to be handled by the initscripts.
  • Loading branch information
robshakir committed Aug 26, 2015
1 parent d0445e7 commit 40dad90
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.debian
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ The package name is fb-tac-plus, config is stored in /etc/tac_plus.conf
initscripts are /etc/init.d/fb-tac-plus.

Enjoy, and thanks to the facebook guys for the changes that they made
here :-)
here :-)
2 changes: 1 addition & 1 deletion debian-jessie/debian/fb-tac-plus.default
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# /etc/init.d/fb-tac-plus

CONFIG_FILE=/etc/tac_plus.conf
DAEMON_OPTS="-d 16 -L"
DAEMON_OPTS="-d 16 -L -B 0.0.0.0 -B ::"
19 changes: 14 additions & 5 deletions debian-jessie/debian/fb-tac-plus.init
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ NAME="fb-tac-plus"
DESC="TACACS+ authentication daemon"
LOGDIR=/var/log/
STARTTIME=1

PIDFILE=/var/run/tac_plus.pid
PIDFILEBASE=/var/run/tac_plus.pid

test -x $DAEMON || exit 0

Expand All @@ -27,15 +26,25 @@ test -x $DAEMON || exit 0
# at /etc/default/$NAME
DAEMON_OPTS="-d 16" # Additional options given to the server
CONFIG_FILE="/etc/tac_plus.conf"

LOGFILE=$LOGDIR/tac_plus.log # Server logfile

# Include defaults if available
if [ -f /etc/default/$NAME ] ; then
. /etc/default/$NAME
fi

DAEMON_ARGS="$DAEMON_OPTS -C $CONFIG_FILE"
# we need to parse the options that were handed to the daemon to check
# what the pidfile(s) should be called - the PID is set based on the
# last -B argument
# we also need to give awk access to this variable - hence the export.
export DAEMON_OPTS
PIDEXT=`/usr/bin/awk 'BEGIN { split(ENVIRON["DAEMON_OPTS"], array, " "); for (i=1;i in array;i++) { if(array[i] == "-B"){ current=array[i+1]; } } print current; }'`

if [ "$PIDEXT" = "" ]; then
PIDFILE=$PIDFILEBASE
else
PIDFILE=$PIDFILEBASE.$PIDEXT
fi

# Check that the user exists (if we set a user)
# Does the user exist?
Expand Down Expand Up @@ -79,7 +88,7 @@ running() {
start_server() {
# Start the process using the wrapper
if check_config_quiet ; then
start-stop-daemon --start --quiet --pidfile $PIDFILE \
start-stop-daemon --start --quiet -m --pidfile $PIDFILE \
--exec $DAEMON -- $DAEMON_ARGS
errcode=$?
return $errcode
Expand Down
Binary file modified debian-jessie/fb-tac-plus_4.0.4.19.1-1.debian.tar.xz
Binary file not shown.
6 changes: 3 additions & 3 deletions debian-jessie/fb-tac-plus_4.0.4.19.1-1.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Package-List:
fb-tac-plus deb net optional arch=any
Checksums-Sha1:
b49c51e746fc91857d0eda436a11e53b8fa63ef6 676519 fb-tac-plus_4.0.4.19.1.orig.tar.gz
109596387f29c7057af6e8605dd2af2c2644ca73 4164 fb-tac-plus_4.0.4.19.1-1.debian.tar.xz
1d05591ec6ab06064a50359ea2fc15cfc55b1441 4412 fb-tac-plus_4.0.4.19.1-1.debian.tar.xz
Checksums-Sha256:
2884bda4579a6ecd82b200ae1737098e5dacef12c6826c2704d92709902cc629 676519 fb-tac-plus_4.0.4.19.1.orig.tar.gz
a1b9b2ae118226d62381afbb5ae3983658e663b5cbb4041b5b8d0de0594f0535 4164 fb-tac-plus_4.0.4.19.1-1.debian.tar.xz
a6ab911601c287a5f2bb19834cb3212fc04c80901abdcca141459a9be4f2dda0 4412 fb-tac-plus_4.0.4.19.1-1.debian.tar.xz
Files:
9c8f251ca797b50983f4fb07205f06b3 676519 fb-tac-plus_4.0.4.19.1.orig.tar.gz
80743ab88539e32e458e7a60c65f9533 4164 fb-tac-plus_4.0.4.19.1-1.debian.tar.xz
2f90c44493ff6a2df4540e0ef39409a8 4412 fb-tac-plus_4.0.4.19.1-1.debian.tar.xz
2 changes: 1 addition & 1 deletion debian-wheezy/debian/fb-tac-plus.default
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# /etc/init.d/fb-tac-plus

CONFIG_FILE=/etc/tac_plus.conf
DAEMON_OPTS="-d 16 -L"
DAEMON_OPTS="-d 16 -L -B 0.0.0.0 -B ::"
19 changes: 14 additions & 5 deletions debian-wheezy/debian/fb-tac-plus.init
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ NAME="fb-tac-plus"
DESC="TACACS+ authentication daemon"
LOGDIR=/var/log/
STARTTIME=1

PIDFILE=/var/run/tac_plus.pid
PIDFILEBASE=/var/run/tac_plus.pid

test -x $DAEMON || exit 0

Expand All @@ -27,15 +26,25 @@ test -x $DAEMON || exit 0
# at /etc/default/$NAME
DAEMON_OPTS="-d 16" # Additional options given to the server
CONFIG_FILE="/etc/tac_plus.conf"

LOGFILE=$LOGDIR/tac_plus.log # Server logfile

# Include defaults if available
if [ -f /etc/default/$NAME ] ; then
. /etc/default/$NAME
fi

DAEMON_ARGS="$DAEMON_OPTS -C $CONFIG_FILE"
# we need to parse the options that were handed to the daemon to check
# what the pidfile(s) should be called - the PID is set based on the
# last -B argument
# we also need to give awk access to this variable - hence the export.
export DAEMON_OPTS
PIDEXT=`/usr/bin/awk 'BEGIN { split(ENVIRON["DAEMON_OPTS"], array, " "); for (i=1;i in array;i++) { if(array[i] == "-B"){ current=array[i+1]; } } print current; }'`

if [ "$PIDEXT" = "" ]; then
PIDFILE=$PIDFILEBASE
else
PIDFILE=$PIDFILEBASE.$PIDEXT
fi

# Check that the user exists (if we set a user)
# Does the user exist?
Expand Down Expand Up @@ -79,7 +88,7 @@ running() {
start_server() {
# Start the process using the wrapper
if check_config_quiet ; then
start-stop-daemon --start --quiet --pidfile $PIDFILE \
start-stop-daemon --start --quiet -m --pidfile $PIDFILE \
--exec $DAEMON -- $DAEMON_ARGS
errcode=$?
return $errcode
Expand Down
2 changes: 1 addition & 1 deletion debian-wheezy/debian/install
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tac_plus.conf etc/
tac_plus.conf etc
Binary file not shown.
Binary file removed debian-wheezy/fb-tac-plus_4.0.4.19.1-1.debian.tar.xz
Binary file not shown.
16 changes: 8 additions & 8 deletions debian-wheezy/fb-tac-plus_4.0.4.19.1-1.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Version: 4.0.4.19.1-1
Maintainer: Rob Shakir <[email protected]>
Standards-Version: 4.0.4.19
Build-Depends: libaudit0 (>= 1:1.7.18-1.1), libaudit-dev (>= 1:1.7.18-1.1), debhelper (>= 9), libpam0g (>= 1.1.3-7.1), libpam0g-dev (>= 1.1.3-7.1), libwrap0 (>= 7.6.q-24), libwrap0-dev (>= 7.6.q-24), libc6 (>= 2.13-38+deb7u8), libc6-dev (>= 2.13-38+deb7u8), flex (>= 2.5.35-10.1), bison (>= 1:2.5.dfsg-2.1)
Package-List:
fb-tac-plus deb net optional arch=any
Checksums-Sha1:
Package-List:
fb-tac-plus deb net optional
Checksums-Sha1:
b49c51e746fc91857d0eda436a11e53b8fa63ef6 676519 fb-tac-plus_4.0.4.19.1.orig.tar.gz
ba685c799de9f65c915933cc36beb75a3d74432e 4164 fb-tac-plus_4.0.4.19.1-1.debian.tar.xz
Checksums-Sha256:
5c0377805db5d92f85d2189392b0dafe3bff9aa3 4565 fb-tac-plus_4.0.4.19.1-1.debian.tar.gz
Checksums-Sha256:
2884bda4579a6ecd82b200ae1737098e5dacef12c6826c2704d92709902cc629 676519 fb-tac-plus_4.0.4.19.1.orig.tar.gz
b5d776625823a08333c22bff308cd38961f3995171144e08dc15b0bbadc90da0 4164 fb-tac-plus_4.0.4.19.1-1.debian.tar.xz
Files:
624a2f13e7de24e160ffdcbdf284ab6839a0c5baa591f9a453601816578bb8c3 4565 fb-tac-plus_4.0.4.19.1-1.debian.tar.gz
Files:
9c8f251ca797b50983f4fb07205f06b3 676519 fb-tac-plus_4.0.4.19.1.orig.tar.gz
20de834a23f422e694996eaba89ce0f1 4164 fb-tac-plus_4.0.4.19.1-1.debian.tar.xz
76d85853a1566dd0523135901050c5a0 4565 fb-tac-plus_4.0.4.19.1-1.debian.tar.gz

0 comments on commit 40dad90

Please sign in to comment.