⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Commit 6336052

Browse files
committed
Fix behaviour on upgrade
Use systemd try-restart to ensure we do still restart when upgrading, just no on initial install.
1 parent 6856b09 commit 6336052

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

distributions/otelcol-contrib/postinstall-rpm.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ if command -v systemctl >/dev/null 2>&1; then
77
if [ -d /run/systemd/system ]; then
88
systemctl daemon-reload
99
fi
10+
if [ -f /etc/otelcol-contrib/config.yaml ]; then
11+
if [ -d /run/systemd/system ]; then
12+
systemctl try-restart otelcol-contrib.service
13+
fi
14+
fi
1015
fi

distributions/otelcol-otlp/postinstall-rpm.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ if command -v systemctl >/dev/null 2>&1; then
77
if [ -d /run/systemd/system ]; then
88
systemctl daemon-reload
99
fi
10-
if [ ! -f /etc/otelcol-otlp/config.yaml ]; then
10+
if [ -f /etc/otelcol-otlp/config.yaml ]; then
11+
if [ -d /run/systemd/system ]; then
12+
systemctl try-restart otelcol-otlp.service
13+
fi
14+
else
1115
echo "Make sure to configure otelcol-otlp by creating /etc/otelcol-otlp/config.yaml"
1216
fi
1317
fi

distributions/otelcol/postinstall-rpm.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ if command -v systemctl >/dev/null 2>&1; then
77
if [ -d /run/systemd/system ]; then
88
systemctl daemon-reload
99
fi
10+
if [ -f /etc/otelcol/config.yaml ]; then
11+
if [ -d /run/systemd/system ]; then
12+
systemctl try-restart otelcol.service
13+
fi
14+
fi
1015
fi

0 commit comments

Comments
 (0)