1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

Bug #987: Create the ONE_AUTH file during the packages installation in their proper path. Move functionality of ONE_AUTH generation to the package install scripts

This commit is contained in:
Jaime Melis 2011-11-17 12:56:25 +01:00
parent f454054f99
commit 997f057e75
4 changed files with 4 additions and 30 deletions

View File

@ -36,12 +36,7 @@ do_start()
{
mkdir -p /var/run/one /var/lock/one
chown oneadmin /var/run/one /var/lock/one
ONE_AUTH_FILE=/var/lib/one/auth
if [ ! -f $ONE_AUTH_FILE ]; then
PASSWORD=$(cat /dev/urandom|tr -dc 'a-zA-Z0-9'|fold -w 10|head -n1)
su oneadmin -s /bin/sh -c "echo oneadmin:$PASSWORD > $ONE_AUTH_FILE"
fi
ONE_AUTH=$ONE_AUTH_FILE su oneadmin -s /bin/sh -c 'one start'
su oneadmin -s /bin/sh -c 'one start'
}
#

View File

@ -36,12 +36,7 @@ do_start()
{
mkdir -p /var/run/one /var/lock/one
chown oneadmin /var/run/one /var/lock/one
ONE_AUTH_FILE=/var/lib/one/auth
if [ ! -f $ONE_AUTH_FILE ]; then
PASSWORD=$(cat /dev/urandom|tr -dc 'a-zA-Z0-9'|fold -w 10|head -n1)
su oneadmin -s /bin/sh -c "echo oneadmin:$PASSWORD > $ONE_AUTH_FILE"
fi
ONE_AUTH=$ONE_AUTH_FILE su oneadmin -s /bin/sh -c 'one start'
su oneadmin -s /bin/sh -c 'one start'
}
#

View File

@ -34,19 +34,9 @@ check() {
}
start() {
check
ONE_AUTH_FILE=/var/lib/one/auth
if [ ! -f $ONE_AUTH_FILE ]; then
PASSWORD=$(cat /dev/urandom|tr -dc 'a-zA-Z0-9'|fold -w 10|head -n1)
su oneadmin -s /bin/sh -c "echo oneadmin:$PASSWORD > $ONE_AUTH_FILE"
fi
echo -n $"Starting OpenNebula daemon: "
daemon --user oneadmin ONE_AUTH=$ONE_AUTH_FILE $ONE_BIN start
daemon --user oneadmin $ONE_BIN start
RETVAL=$?
echo
return $RETVAL

View File

@ -34,14 +34,8 @@ rc_reset
case "$1" in
start)
ONE_AUTH_FILE=/var/lib/one/auth
if [ ! -f $ONE_AUTH_FILE ]; then
PASSWORD=$(cat /dev/urandom|tr -dc 'a-zA-Z0-9'|fold -w 10|head -n1)
su oneadmin -s /bin/sh -c "echo oneadmin:$PASSWORD > $ONE_AUTH_FILE"
fi
echo -n "Starting ONE "
ONE_AUTH=$ONE_AUTH_FILE /sbin/startproc -u oneadmin $ONE_BIN start
/sbin/startproc -u oneadmin $ONE_BIN start
rc_status -v
;;