mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-26 06:50:09 +03:00
sed expression in install.sh was not compatible with Mac OS X
Changes the permission of newly created images Default permissions of the image repository
This commit is contained in:
parent
430fc888e5
commit
9cbf3cac97
22
install.sh
22
install.sh
@ -94,6 +94,7 @@ if [ -z "$ROOT" ] ; then
|
||||
ETC_LOCATION="/etc/one"
|
||||
LOG_LOCATION="/var/log/one"
|
||||
VAR_LOCATION="/var/lib/one"
|
||||
IMAGES_LOCATION="$VAR_LOCATION/images"
|
||||
RUN_LOCATION="/var/run/one"
|
||||
LOCK_LOCATION="/var/lock/one"
|
||||
INCLUDE_LOCATION="/usr/include"
|
||||
@ -102,7 +103,7 @@ if [ -z "$ROOT" ] ; then
|
||||
if [ "$CLIENT" = "no" ]; then
|
||||
MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $ETC_LOCATION $VAR_LOCATION \
|
||||
$INCLUDE_LOCATION $SHARE_LOCATION \
|
||||
$LOG_LOCATION $RUN_LOCATION $LOCK_LOCATION"
|
||||
$LOG_LOCATION $RUN_LOCATION $LOCK_LOCATION $IMAGES_LOCATION"
|
||||
|
||||
DELETE_DIRS="$LIB_LOCATION $ETC_LOCATION $LOG_LOCATION $VAR_LOCATION \
|
||||
$RUN_LOCATION $SHARE_DIRS"
|
||||
@ -121,12 +122,13 @@ else
|
||||
LIB_LOCATION="$ROOT/lib"
|
||||
ETC_LOCATION="$ROOT/etc"
|
||||
VAR_LOCATION="$ROOT/var"
|
||||
IMAGES_LOCATION="$VAR_LOCATION/images"
|
||||
INCLUDE_LOCATION="$ROOT/include"
|
||||
SHARE_LOCATION="$ROOT/share"
|
||||
|
||||
if [ "$CLIENT" = "no" ]; then
|
||||
MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $ETC_LOCATION $VAR_LOCATION \
|
||||
$INCLUDE_LOCATION $SHARE_LOCATION"
|
||||
$INCLUDE_LOCATION $SHARE_LOCATION $IMAGES_LOCATION"
|
||||
|
||||
DELETE_DIRS="$MAKE_DIRS"
|
||||
|
||||
@ -481,7 +483,8 @@ TM_EXAMPLE_SHARE_FILES="share/examples/tm/tm_clone.sh \
|
||||
|
||||
HOOK_SHARE_FILES="share/hooks/ebtables-xen \
|
||||
share/hooks/ebtables-kvm \
|
||||
share/hooks/ebtables-flush"
|
||||
share/hooks/ebtables-flush \
|
||||
share/hooks/image.rb"
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Common Cloud Files
|
||||
@ -638,9 +641,16 @@ else
|
||||
done
|
||||
fi
|
||||
|
||||
# --- Set correct permissions for Image Repository ---
|
||||
|
||||
IMAGES_LOCATION=$(cd $IMAGES_LOCATION;pwd)
|
||||
chown 3770 $IMAGES_LOCATION
|
||||
|
||||
# --- Substitute variables ---
|
||||
|
||||
if [ $INSTALL_ETC="yes" ]; then
|
||||
HOOK_LOCATION=$(cd $SHARE_LOCATION/hooks;pwd)
|
||||
sed -i "s%\[ONE_HOOKS\]%$HOOK_LOCATION%" $ETC_LOCATION/oned.conf
|
||||
if [ "$CLIENT" = "no" -a $INSTALL_ETC="yes" ]; then
|
||||
HOOKS_LOCATION=$(cd $SHARE_LOCATION/hooks;pwd)
|
||||
sed -i -e "s%\[HOOKS_LOCATION\]%$HOOKS_LOCATION%" $ETC_LOCATION/oned.conf
|
||||
sed -i -e "s%\[IMAGES_LOCATION\]%$IMAGES_LOCATION%" $ETC_LOCATION/oned.conf
|
||||
fi
|
||||
|
||||
|
@ -82,7 +82,7 @@ MAC_PREFIX = "02:00"
|
||||
# vd KVM virtual disk
|
||||
#*******************************************************************************
|
||||
|
||||
#IMAGE_REPOSITORY_PATH =
|
||||
IMAGE_REPOSITORY_PATH = [IMAGES_LOCATION]
|
||||
DEFAULT_IMAGE_TYPE = "OS"
|
||||
DEFAULT_DEVICE_PREFIX = "hd"
|
||||
|
||||
@ -266,7 +266,7 @@ HM_MAD = [
|
||||
VM_HOOK = [
|
||||
name = "image",
|
||||
on = "SHUTDOWN",
|
||||
command = "[ONE_HOOKS]/image.rb",
|
||||
command = "[HOOKS_LOCATION]/image.rb",
|
||||
arguments = "$VMID" ]
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
@ -206,6 +206,7 @@ module OpenNebula
|
||||
|
||||
begin
|
||||
FileUtils.move(path, source)
|
||||
FileUtils.chmod(0660, source)
|
||||
rescue Exception => e
|
||||
return OpenNebula::Error.new(e.message)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user