Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Added PRIVBIND to permit configurations requiring reserved ports (< 1024... #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions debian/td-agent.init
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ DAEMON_ARGS="/usr/sbin/td-agent $DAEMON_ARGS --daemon $PIDFILE --log /var/log/td
SCRIPTNAME=/etc/init.d/$NAME
START_STOP_DAEMON_ARGS=""

# Uncomment if the configuration requires the use of local reserved ports (<1024).
# You may need to install privbind (e.g.: On Ubuntu, sudo apt-get install privbind).
# PRIVBIND="/usr/sbin/privbind -u ${USER}"
PRIVBIND=""

# Exit if the package is not installed
[ -x $DAEMON ] || exit 0

Expand Down Expand Up @@ -79,10 +84,10 @@ do_start()
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
${PRIVBIND} start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
${START_STOP_DAEMON_ARGS} --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
${PRIVBIND} start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
${START_STOP_DAEMON_ARGS} -- $DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
Expand Down