Skip to content

Commit 74dfd2b

Browse files
committed
Use linux command id to get the list of groups - supports nss and pam
1 parent 3498fa3 commit 74dfd2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/logstash.sysv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ start() {
5252

5353
# chown doesn't grab the suplimental groups when setting the user:group - so we have to do it for it.
5454
# Boy, I hope we're root here.
55-
SGROUPS=$(grep "$LS_USER" /etc/group | grep -v "^$LS_GROUP" | cut -d: -f1 | tr "\\n" "," | sed 's/,$//'; echo '')
55+
SGROUPS=$(id -Gn "$LS_USER" | tr " " "," | sed 's/,$//'; echo '')
5656

5757
if [ ! -z $SGROUPS ]
5858
then

0 commit comments

Comments
 (0)