Skip to content

Commit 6b021f1

Browse files
author
Sebastian Spaink
committed
copy entrypoint.sh
1 parent 688d224 commit 6b021f1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

telegraf/nightly/alpine/entrypoint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ if [ "${1:0:1}" = '-' ]; then
55
set -- telegraf "$@"
66
fi
77

8-
exec "$@"
8+
if [ "$(id -u)" -ne 0 ]; then
9+
exec "$@"
10+
else
11+
exec su-exec telegraf "$@"
12+
fi

telegraf/nightly/entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -e
33

44
if [ "${1:0:1}" = '-' ]; then
55
set -- telegraf "$@"
66
fi
77

8-
if [ "$(id -u)" -ne 0 ]; then
8+
if [ $EUID -ne 0 ]; then
99
exec "$@"
1010
else
11-
exec su-exec telegraf "$@"
11+
exec setpriv --reuid telegraf --init-groups "$@"
1212
fi

0 commit comments

Comments
 (0)