From 677223531ea249133f0d8062a28414e2aa6b36f3 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Fri, 20 Mar 2020 14:50:09 +0300 Subject: [PATCH] Add non-zero exit code for non-writable config dir and missing app-dir (CLI only) --- changelog/unreleased/37148 | 7 +++++++ lib/base.php | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/37148 diff --git a/changelog/unreleased/37148 b/changelog/unreleased/37148 new file mode 100644 index 000000000000..c1e2d424d3e7 --- /dev/null +++ b/changelog/unreleased/37148 @@ -0,0 +1,7 @@ +Bugfix: Fix CLI zero exit code on startup errors + +Zero exit code was returned on startup with a missing app directory +or a non-writable config directory. Now exit code is 1. + +https://github.com/owncloud/core/issues/37098 +https://github.com/owncloud/core/pull/37148 diff --git a/lib/base.php b/lib/base.php index ff59b196c26e..a125bbde2a24 100644 --- a/lib/base.php +++ b/lib/base.php @@ -251,7 +251,7 @@ public static function checkConfig() { echo $l->t('This can usually be fixed by giving the webserver write access to the config directory')."\n"; echo "\n"; echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-dir_permissions') ])."\n"; - exit; + exit(1); } else { OC_Template::printErrorPage( $l->t('Cannot write into "config" directory!'), @@ -530,7 +530,7 @@ public static function init() { // we can't use the template error page here, because this needs the // DI container which isn't available yet print($e->getMessage()); - exit(); + exit(1); } // setup the basic server