Fixes #186 (install and init script for el5)
This commit is contained in:
parent
d979ee5573
commit
2841c02809
|
@ -1,5 +1,8 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
# chkconfig: 2345 99 01
|
||||
# description: Telegraf daemon
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: telegraf
|
||||
# Required-Start: $all
|
||||
|
|
|
@ -160,7 +160,14 @@ rm -f $INSTALL_ROOT_DIR/init.sh
|
|||
ln -sfn $INSTALL_ROOT_DIR/versions/$version/telegraf $INSTALL_ROOT_DIR/telegraf
|
||||
|
||||
if ! id telegraf >/dev/null 2>&1; then
|
||||
useradd --help 2>&1| grep -- --system > /dev/null 2>&1
|
||||
old_useradd=\$?
|
||||
if [[ \$old_useradd == 0 ]]
|
||||
then
|
||||
useradd --system -U -M telegraf
|
||||
else
|
||||
groupadd telegraf && useradd -M -g telegraf telegraf
|
||||
fi
|
||||
fi
|
||||
|
||||
# Systemd
|
||||
|
|
Loading…
Reference in New Issue