Skip to content

Commit 5cd111f

Browse files
committed
Fix: Add multiflexi user to www-data group for config access
- Extended ADDGROUP to include both 'multiflexi' and 'www-data' groups - Enhanced postinst script to support multiple groups in ADDGROUP variable - Ensures multiflexi-scheduler and multiflexi-executor can read /etc/multiflexi/multiflexi.env - Fixes database configuration access for MultiFlexi services
1 parent 9046167 commit 5cd111f

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

debian/multiflexi-cli.postinst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ configure)
4141
[ -z "$SERVER_GROUP" ] && SERVER_GROUP=multiflexi
4242

4343
# Groups that the user will be added to, if undefined, then none.
44-
ADDGROUP="multiflexi"
44+
ADDGROUP="multiflexi www-data"
4545

4646
# create user to avoid running server as root
4747
# 1. create group if not existing
@@ -73,12 +73,14 @@ configure)
7373
chown $SERVER_USER:adm $SERVER_HOME
7474
chmod u=rwx,g=rxs,o= $SERVER_HOME
7575
fi
76-
# 6. Add the user to the ADDGROUP group
77-
if test -n $ADDGROUP; then
78-
if ! groups $SERVER_USER | cut -d: -f2 |
79-
grep -qw $ADDGROUP; then
80-
adduser $SERVER_USER $ADDGROUP
81-
fi
76+
# 6. Add the user to the ADDGROUP groups
77+
if test -n "$ADDGROUP"; then
78+
for group in $ADDGROUP; do
79+
if ! groups $SERVER_USER | cut -d: -f2 |
80+
grep -qw $group; then
81+
adduser $SERVER_USER $group
82+
fi
83+
done
8284
fi
8385

8486
;;

0 commit comments

Comments
 (0)