Skip to content

Commit d76a6d5

Browse files
committed
Fix xargs do not run if empty
1 parent a1608a1 commit d76a6d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

root/etc/cont-init.d/30-config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ if [ -f "/usr/bin/find" ] && [ -f "/usr/bin/xargs" ]; then
2323
echo "setting permissions::configuration"
2424
CORES=$(nproc --all)
2525
find /config -maxdepth 4 -mindepth 1 -path /config/workspace -prune -false -o -type d -print0 | \
26-
xargs --max-args=1 --max-procs=$((CORES*2*8)) \
26+
xargs -r --max-args=1 --max-procs=$((CORES*2*8)) \
2727
chown -R abc:abc
2828

2929
echo "setting permissions::workspace"
3030
chown abc:abc /config/workspace
3131
find /config/workspace -maxdepth 4 -mindepth 1 -type d -print0 | \
32-
xargs --max-args=1 --max-procs=$((CORES*2*16)) \
32+
xargs -r --max-args=1 --max-procs=$((CORES*2*16)) \
3333
chown -R abc:abc
3434
else
3535
chown -R abc:abc \

0 commit comments

Comments
 (0)