Add common log and configuration places
Change-Id: I2de692931fbc3de923489eb943ecc233d1366730
This commit is contained in:
parent
84600e4a1c
commit
a1173478ce
@ -22,7 +22,9 @@ PIPAPPS="pip python-pip pip-python"
|
||||
PIPCMD=""
|
||||
SERVICE_SRV_NAME="murano-conductor"
|
||||
GIT_CLONE_DIR=`echo $SERVICE_CONTENT_DIRECTORY | sed -e "s/$SERVICE_SRV_NAME//"`
|
||||
ETC_CFG_DIR="/etc/$SERVICE_SRV_NAME"
|
||||
#ETC_CFG_DIR="/etc/$SERVICE_SRV_NAME"
|
||||
ETC_CFG_DIR="/etc/murano"
|
||||
LOG_DIR="/var/log/murano/"
|
||||
SERVICE_CONFIG_FILE_PATH="$ETC_CFG_DIR/conductor.conf"
|
||||
|
||||
# Functions
|
||||
@ -150,15 +152,29 @@ CLONE_FROM_GIT=$1
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
# Creating log directory for the murano
|
||||
if [ ! -d $LOG_DIR ];then
|
||||
log "Creating $LOG_DIR direcory..."
|
||||
mkdir -p $LOG_DIR
|
||||
if [ $? -ne 0 ];then
|
||||
log "Can't create $LOG_DIR, exiting!!!"
|
||||
exit 1
|
||||
fi
|
||||
chmod -R a+rw $LOG_DIR
|
||||
fi
|
||||
# making sample configs
|
||||
log "Making sample configuration files at \"$ETC_CFG_DIR\""
|
||||
for file in $(ls $SERVICE_CONTENT_DIRECTORY/etc)
|
||||
do
|
||||
if [ -d "$SERVICE_CONTENT_DIRECTORY/etc/$file" ];then
|
||||
cp -f -R "$SERVICE_CONTENT_DIRECTORY/etc/$file" "$ETC_CFG_DIR/"
|
||||
else
|
||||
cp -f "$SERVICE_CONTENT_DIRECTORY/etc/$file" "$ETC_CFG_DIR/$file.sample"
|
||||
fi
|
||||
done
|
||||
# making templates data
|
||||
log "Making templates directory"
|
||||
cp -f -R "$SERVICE_CONTENT_DIRECTORY/data" "$ETC_CFG_DIR/"
|
||||
#log "Making templates directory"
|
||||
#cp -f -R "$SERVICE_CONTENT_DIRECTORY/data" "$ETC_CFG_DIR/"
|
||||
}
|
||||
|
||||
# searching for service executable in path
|
||||
@ -202,9 +218,9 @@ purgeinit()
|
||||
# uninstall
|
||||
uninst()
|
||||
{
|
||||
# Uninstall trough pip
|
||||
# Uninstall trough pip
|
||||
find_pip
|
||||
# looking up for python package installed
|
||||
# looking up for python package installed
|
||||
PYPKG=$SERVICE_SRV_NAME
|
||||
_pkg=$($PIPCMD freeze | grep $PYPKG)
|
||||
if [ $? -eq 0 ]; then
|
||||
|
30
setup.sh
30
setup.sh
@ -20,7 +20,9 @@ SERVICE_CONTENT_DIRECTORY=`cd $(dirname "$0") && pwd`
|
||||
PREREQ_PKGS="upstart wget git make python-pip python-dev python-mysqldb libxml2-dev libxslt-dev libffi-dev"
|
||||
SERVICE_SRV_NAME="murano-conductor"
|
||||
GIT_CLONE_DIR=`echo $SERVICE_CONTENT_DIRECTORY | sed -e "s/$SERVICE_SRV_NAME//"`
|
||||
ETC_CFG_DIR="/etc/$SERVICE_SRV_NAME"
|
||||
#ETC_CFG_DIR="/etc/$SERVICE_SRV_NAME"
|
||||
ETC_CFG_DIR="/etc/murano"
|
||||
LOG_DIR="/var/log/murano/"
|
||||
SERVICE_CONFIG_FILE_PATH="$ETC_CFG_DIR/conductor.conf"
|
||||
|
||||
# Functions
|
||||
@ -128,15 +130,29 @@ CLONE_FROM_GIT=$1
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
# Creating log directory for the murano
|
||||
if [ ! -d $LOG_DIR ];then
|
||||
log "Creating $LOG_DIR direcory..."
|
||||
mkdir -p $LOG_DIR
|
||||
if [ $? -ne 0 ];then
|
||||
log "Can't create $LOG_DIR, exiting!!!"
|
||||
exit 1
|
||||
fi
|
||||
chmod -R a+rw $LOG_DIR
|
||||
fi
|
||||
# making sample configs
|
||||
log "Making sample configuration files at \"$ETC_CFG_DIR\""
|
||||
for file in $(ls $SERVICE_CONTENT_DIRECTORY/etc)
|
||||
do
|
||||
if [ -d "$SERVICE_CONTENT_DIRECTORY/etc/$file" ];then
|
||||
cp -f -R "$SERVICE_CONTENT_DIRECTORY/etc/$file" "$ETC_CFG_DIR/"
|
||||
else
|
||||
cp -f "$SERVICE_CONTENT_DIRECTORY/etc/$file" "$ETC_CFG_DIR/$file.sample"
|
||||
fi
|
||||
done
|
||||
# making templates data
|
||||
log "Making templates directory"
|
||||
cp -f -R "$SERVICE_CONTENT_DIRECTORY/data" "$ETC_CFG_DIR/"
|
||||
#log "Making templates directory"
|
||||
#cp -f -R "$SERVICE_CONTENT_DIRECTORY/data" "$ETC_CFG_DIR/"
|
||||
}
|
||||
|
||||
# searching for service executable in path
|
||||
@ -170,8 +186,8 @@ start on runlevel [2345]
|
||||
stop on runlevel [!2345]
|
||||
respawn
|
||||
exec start-stop-daemon --start --chuid root --user root --name $SERVICE_SRV_NAME --exec $SERVICE_EXEC_PATH -- --config-file=$SERVICE_CONFIG_FILE_PATH" > "/etc/init/$SERVICE_SRV_NAME.conf"
|
||||
log "Reloading initctl"
|
||||
initctl reload-configuration
|
||||
log "Reloading initctl"
|
||||
initctl reload-configuration
|
||||
}
|
||||
|
||||
# purge init
|
||||
@ -186,8 +202,8 @@ purgeinit()
|
||||
# uninstall
|
||||
uninst()
|
||||
{
|
||||
# Uninstall trough pip
|
||||
# looking up for python package installed
|
||||
# Uninstall trough pip
|
||||
# looking up for python package installed
|
||||
PYPKG=$SERVICE_SRV_NAME
|
||||
pip freeze | grep $PYPKG
|
||||
if [ $? -eq 0 ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user