Skip to content

Commit 9933783

Browse files
committed
run post-init scruipt sregardless of user
1 parent 947aafd commit 9933783

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

python3/bin/entrypoint.sh

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,16 @@ then
3737
echo "Switching to user $RUNAS_UID"
3838
useradd -M -u $RUNAS_UID openconext
3939
PRIVDROP="runuser --user=openconext -- "
40-
fi
40+
fi
4141
echo "Dropping privileges to $($PRIVDROP id -u):$($PRIVDROP id -g)"
42+
fi
4243

43-
# run custom scripts after dropping privileges
44-
echo "Running custom scripts in /container-init-post as $RUNAS_UID"
45-
if [ -d "/container-init-post" ]
46-
then
47-
# run all scripts using run-parts
48-
${PRIVDROP} run-parts --verbose --regex '.*' "/container-init-post"
49-
fi
50-
else
51-
echo "Warning: not dropping privileges"
52-
if [ -d "/container-init-post" ] && ! find /container-init-post/ -maxdepth 0 -empty
53-
then
54-
echo "Warning: not running scripts in /container-init-post as no user is specified"
55-
fi
44+
# run custom scripts after dropping privileges
45+
echo "Running custom scripts in /container-init-post"
46+
if [ -d "/container-init-post" ]
47+
then
48+
# run all scripts using run-parts
49+
${PRIVDROP} run-parts --verbose --regex '.*' "/container-init-post"
5650
fi
5751

5852
# Hand off to the CMD

0 commit comments

Comments
 (0)