Skip to content

Commit

Permalink
Ignore errors in systemd
Browse files Browse the repository at this point in the history
closes #1022
  • Loading branch information
sparrc committed Apr 22, 2016
1 parent 194288c commit 23f2b47
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ based on _prefix_ in addition to globs. This means that a filter like
- [#1024](https://github.com/influxdata/telegraf/issues/1024): Don't replace `.` with `_` in datadog output.
- [#1058](https://github.com/influxdata/telegraf/issues/1058): Fix possible leaky TCP connections in influxdb output.
- [#1044](https://github.com/influxdata/telegraf/pull/1044): Fix SNMP OID possible collisions. Thanks @relip
- [#1022](https://github.com/influxdata/telegraf/issues/1022): Dont error deb/rpm install on systemd errors.

## v0.12.1 [2016-04-14]

Expand Down
28 changes: 14 additions & 14 deletions scripts/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function install_init {

function install_systemd {
cp -f $SCRIPT_DIR/telegraf.service /lib/systemd/system/telegraf.service
systemctl enable telegraf
systemctl enable telegraf || true
systemctl daemon-reload || true
}

Expand Down Expand Up @@ -53,29 +53,29 @@ if [[ -f /etc/redhat-release ]]; then
# RHEL-variant logic
which systemctl &>/dev/null
if [[ $? -eq 0 ]]; then
install_systemd
install_systemd
else
# Assuming sysv
install_init
install_chkconfig
# Assuming sysv
install_init
install_chkconfig
fi
elif [[ -f /etc/debian_version ]]; then
# Debian/Ubuntu logic
which systemctl &>/dev/null
if [[ $? -eq 0 ]]; then
install_systemd
systemctl restart telegraf
install_systemd
systemctl restart telegraf || echo "WARNING: systemd not running."
else
# Assuming sysv
install_init
install_update_rcd
invoke-rc.d telegraf restart
# Assuming sysv
install_init
install_update_rcd
invoke-rc.d telegraf restart
fi
elif [[ -f /etc/os-release ]]; then
source /etc/os-release
if [[ $ID = "amzn" ]]; then
# Amazon Linux logic
install_init
install_chkconfig
# Amazon Linux logic
install_init
install_chkconfig
fi
fi

0 comments on commit 23f2b47

Please sign in to comment.