Changed nohup fallback command to use 'sudo -u' so that Telegraf doesn't run as the root user.
This commit is contained in:
parent
e428d11add
commit
7f992fd321
|
@ -138,7 +138,7 @@ case $1 in
|
||||||
if which start-stop-daemon > /dev/null 2>&1; then
|
if which start-stop-daemon > /dev/null 2>&1; then
|
||||||
start-stop-daemon --chuid $USER:$GROUP --start --quiet --pidfile $pidfile --exec $daemon -- -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR &
|
start-stop-daemon --chuid $USER:$GROUP --start --quiet --pidfile $pidfile --exec $daemon -- -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR &
|
||||||
else
|
else
|
||||||
nohup $daemon -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR &
|
nohup sudo -u $USER $daemon -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR &
|
||||||
fi
|
fi
|
||||||
log_success_msg "$name process was started"
|
log_success_msg "$name process was started"
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue