diff --git a/scripts/init.sh b/scripts/init.sh index f104813dd..1994deb39 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -138,7 +138,7 @@ case $1 in 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 & else - nohup sudo -u $USER $daemon -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR & + su -s /bin/sh -c "nohup $daemon -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR &" $USER fi log_success_msg "$name process was started" ;;