From d8bf6585fa089e80eca36e67cd992c14180ab88b Mon Sep 17 00:00:00 2001
From: Thierry Parmentelat <thierry.parmentelat@inria.fr>
Date: Tue, 21 Jul 2015 14:27:25 +0200
Subject: [PATCH] slight change in the initscript this is all very odd; out of
 the blue the SFA service within its f20 VM (inside bigjohn that is a f21 LXC
 host) was not starting properly any longer.. the test to decide whether to
 start postgresql had to be rewritten, reading now check || { start-db ; ... }
 rather than if [ ! check ] ; then start-db ... ; fi

---
 init.d/sfa | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/init.d/sfa b/init.d/sfa
index e3b80f90..d77a58d7 100755
--- a/init.d/sfa
+++ b/init.d/sfa
@@ -234,14 +234,14 @@ function db_start () {
 
     ######## Start up the server
     # not too nice, but.. when co-located with myplc we'll let it start/stop postgresql
-    if [ ! postgresql_check ] ; then
+    postgresql_check || {
 	service postgresql start >& /dev/null
 	MESSAGE=$"Starting PostgreSQL server"
 	echo -n "$MESSAGE"
 	[ "$ERRORS" == 0 ] && success "$MESSAGE" || failure "$MESSAGE" ; echo
 	# best-effort to make sure we turn it back off when running stop
 	touch $POSTGRESQL_STARTED
-    fi
+    }
     postgresql_check
     check
 	
-- 
2.47.0