Skip to content

Commit

Permalink
install and init script for el5
Browse files Browse the repository at this point in the history
Fixes #186
Closes #203
  • Loading branch information
Eugene Dementiev authored and sparrc committed Sep 16, 2015
1 parent 2110655 commit 406e980
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#! /usr/bin/env bash

# chkconfig: 2345 99 01
# description: Telegraf daemon

### BEGIN INIT INFO
# Provides: telegraf
# Required-Start: $all
Expand Down
7 changes: 7 additions & 0 deletions scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 406e980

Please sign in to comment.