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:
parent
f454054f99
commit
997f057e75
@ -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'
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -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'
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
;;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user