diff --git a/init b/init index 84c1112..fb335d9 100755 --- a/init +++ b/init @@ -82,9 +82,12 @@ elif [ "$role" = "queue" -a -e artisan ]; then echo "* Running the queue..." # We'll delay starting in case the app is caching sleep 15 + + su www-data -s /bin/sh -c " while true; do php ${PHP_OPTIONS} artisan queue:work --verbose --once --tries=${WORK_TRIES:-1} --timeout=${WORK_TIMEOUT:-90} ${WORK_QUEUES:+--queue=${WORK_QUEUES}} ${WORK_MEMORY:+--memory=${WORK_MEMORY}} done + " elif [ "$role" = "scheduler" -a -e artisan ]; then if [ ! -e ${php}/.env ]; then @@ -96,10 +99,12 @@ elif [ "$role" = "scheduler" -a -e artisan ]; then # We'll delay starting in case the app is caching sleep 15 - while [ true ]; do - php ${PHP_OPTIONS} artisan schedule:run --verbose --no-interaction & + su www-data -s /bin/sh -c " + while true; do + (php ${PHP_OPTIONS} artisan schedule:run --verbose --no-interaction &) sleep 60 done + " else echo "? NO container role \"${role}\", AND/OR no laravel install, just starting php-fpm"