From ee1890993598788edb78991f369490e1b8122dd2 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 10 May 2016 11:41:25 +0200 Subject: [PATCH] allow all apps to be restored on boot When rebooting a Dokku host the init process tries to restore all apps using `dokku ps:restore`, alphabetically. If an app is defined but not deployed, the function `ps_start` called by `dokku ps:restore` will exit 0 and stop trying to restore the other apps later in the alphabet. This change fixes the restore behaviour. --- plugins/ps/functions | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/ps/functions b/plugins/ps/functions index 4573d2f07..7cf96a52b 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -91,12 +91,14 @@ ps_start() { local APP="$1"; verify_app_name "$APP" local IMAGE_TAG=$(get_running_image_tag "$APP"); - ! (is_deployed "$APP") && echo "App $APP has not been deployed" && exit 0 - - if ! (is_app_running "$APP"); then - release_and_deploy "$APP" "$IMAGE_TAG" + if (is_deployed "$APP"); then + if ! (is_app_running "$APP"); then + release_and_deploy "$APP" "$IMAGE_TAG" + else + echo "App $APP already running" + fi else - echo "App $APP already running" + echo "App $APP has not been deployed" fi }