Skip to content

Commit

Permalink
Start influxd with up-to-date launch params
Browse files Browse the repository at this point in the history
Simplify for now, and more complexitity can come later if needed.
  • Loading branch information
otoolep committed Jan 27, 2015
1 parent 2aa9b6e commit a2b09ca
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ if [ "x$STDOUT" == "x" ]; then
STDOUT=/dev/null
fi

echo "Setting ulimit -n $NOFILES"
if ! ulimit -n $NOFILES >/dev/null 2>&1; then
echo -n "Cannot set the max number of open file descriptors"
fi

function pidofproc() {
if [ $# -ne 3 ]; then
echo "Expected three arguments, e.g. $0 -p pidfile daemon-name"
Expand Down Expand Up @@ -108,17 +103,13 @@ case $1 in
fi
fi
# Start the daemon.
log_success_msg "Starting the process" "$name"
# Start the daemon with the help of start-stop-daemon
# Log the message appropriately
cd /
if which start-stop-daemon > /dev/null 2>&1; then
nohup start-stop-daemon --chuid influxdb:influxdb -d / --start --quiet --oknodo --pidfile $pidfile --exec $daemon -- -pidfile $pidfile -config $config >> $STDOUT 2>&1 &
elif set | egrep '^start_daemon' > /dev/null 2>&1; then
start_daemon -u influxdb ${daemon}-daemon -pidfile $pidfile -config $config >> $STDOUT 2>&1
else
su -s /bin/sh -c "${daemon}-daemon -pidfile $pidfile -config $config >> $STDOUT 2>&1" influxdb
if ! ulimit -n $NOFILES >/dev/null 2>&1; then
echo -n "Cannot set the max number of open file descriptors"
exit 1
fi

log_success_msg "Starting the process" "$name"
nohup $daemon run -config $config -pidfile $pidfile > /dev/null 2>&1 &
log_success_msg "$name process was started"
;;

Expand Down

0 comments on commit a2b09ca

Please sign in to comment.