#!/bin/sh

set -e

for f in /docker-entrypoint.d/*.sh; do
    echo "Running $f"
    chmod +x "$f"
    "$f"
done

exec java $PUPPETDB_JAVA_ARGS -cp /puppetdb.jar \
    clojure.main -m puppetlabs.puppetdb.core "$@" \
    -c /etc/puppetlabs/puppetdb/conf.d/

#!/bin/sh

set -e

chmod +x /docker-entrypoint.d/*.sh
# sync prevents aufs from sometimes returning EBUSY if you exec right after a chmod
sync
for f in /docker-entrypoint.d/*.sh; do
    echo "Running $f"
    "$f"
done

exec java $PUPPETDB_JAVA_ARGS -cp /puppetdb.jar \
    clojure.main -m puppetlabs.puppetdb.core "$@" \
    -c /etc/puppetlabs/puppetdb/conf.d/

Add sync to prevent a 'Text file busy' error
Add sync to prevent a 'Text file busy' error

 - In rare situations running chmod and the script directly afterwards
   causes a 'Text file busy' error See

 - https://github.com/moby/moby/issues/13594 for details
