From cdb222ae239b79949a03ce7114558c5008193427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Font=C3=A1n=20Mui=C3=B1os?= Date: Tue, 14 Jul 2009 17:20:47 +0000 Subject: [PATCH] Start script checks for ONE_AUTH the first time it is started, #125 git-svn-id: http://svn.opennebula.org/one/trunk@692 3034c82b-c49b-4eb3-8279-a7acafdc01c0 --- share/scripts/one | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/share/scripts/one b/share/scripts/one index 875c84fe49..f0ba1514dd 100755 --- a/share/scripts/one +++ b/share/scripts/one @@ -21,6 +21,7 @@ if [ -z "$ONE_LOCATION" ]; then ONE_PID=/var/run/one/oned.pid ONE_SCHEDPID=/var/run/one/sched.pid ONE_CONF=/etc/one/oned.conf + ONE_DB=/var/lib/one/one.db ONED=/usr/bin/oned ONE_SCHEDULER=/usr/bin/mm_sched @@ -30,6 +31,7 @@ else ONE_PID=$ONE_LOCATION/var/oned.pid ONE_SCHEDPID=$ONE_LOCATION/var/sched.pid ONE_CONF=$ONE_LOCATION/etc/oned.conf + ONE_DB=$ONE_LOCATION/var/one.db ONED=$ONE_LOCATION/bin/oned ONE_SCHEDULER=$ONE_LOCATION/bin/mm_sched @@ -79,6 +81,15 @@ start() echo "Can not find $ONE_SCHEDULER." exit 1 fi + + if [ ! -f "$ONE_DB" ]; then + if [ -z "$ONE_AUTH" ]; then + echo "You should have ONE_AUTH set the first time you start" + echo "OpenNebula as it is used to set the credentials for" + echo "the adminitrator user." + exit 1 + fi + fi # Start the one daemon $ONED -f 2>&1 &