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
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
# chkconfig: 2345 99 01
|
||||||
|
# description: Telegraf daemon
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: telegraf
|
# Provides: telegraf
|
||||||
# Required-Start: $all
|
# 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
|
ln -sfn $INSTALL_ROOT_DIR/versions/$version/telegraf $INSTALL_ROOT_DIR/telegraf
|
||||||
|
|
||||||
if ! id telegraf >/dev/null 2>&1; then
|
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
|
useradd --system -U -M telegraf
|
||||||
|
else
|
||||||
|
groupadd telegraf && useradd -M -g telegraf telegraf
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Systemd
|
# Systemd
|
||||||
|
|
Loading…
Reference in New Issue