mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-05 22:14:26 +08:00
Fix for #30 - Use sleep inifinity instead of sleep <number>
Apparently using sleep with very large numbers is not a good idea when your image can be compiled down to 32-bit platforms. This fix uses `sleep infinity` and -- failing that -- tries to sleep for about 68 years (which is exactly 2^15 seconds).
This commit is contained in:
parent
4d12408b5d
commit
35fa2d7acf
1 changed files with 11 additions and 2 deletions
|
@ -1,8 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
noop() {
|
||||
while true; do
|
||||
# 2147483647 = max signed 32-bit integer
|
||||
# 2147483647 s ≅ 70 years
|
||||
sleep infinity || sleep 2147483647
|
||||
done
|
||||
}
|
||||
|
||||
if [ ! -d /etc/opendkim/keys ]; then
|
||||
sleep 9999999999999999999
|
||||
noop
|
||||
elif [ -z "$(find /etc/opendkim/keys -type f ! -name .)" ]; then
|
||||
sleep 9999999999999999999
|
||||
noop
|
||||
else
|
||||
/usr/sbin/opendkim -D -f -x /etc/opendkim/opendkim.conf
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue