Made changes for nonroot daemons run
Change-Id: I17a83b07b6ddb24cb01bf5cb956b67f93cbee6e7
This commit is contained in:
parent
a512ae2314
commit
ed52d5843b
|
@ -31,9 +31,9 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
|
||||||
DESC="murano-api"
|
DESC="murano-api"
|
||||||
NAME=murano-api
|
NAME=murano-api
|
||||||
DAEMON=$(which murano-api)
|
DAEMON=$(which murano-api)
|
||||||
PIDFILE=/var/run/$NAME.pid
|
PIDFILE=/var/run/murano/$NAME.pid
|
||||||
SCRIPTNAME=/etc/init.d/openstack-$NAME
|
SCRIPTNAME=/etc/init.d/openstack-$NAME
|
||||||
SYSTEM_USER=root
|
SYSTEM_USER=murano
|
||||||
CONFIG_FILE=/etc/murano/murano-api.conf
|
CONFIG_FILE=/etc/murano/murano-api.conf
|
||||||
LOCKFILE=/var/lock/subsys/$NAME
|
LOCKFILE=/var/lock/subsys/$NAME
|
||||||
# Exit if the package is not installed
|
# Exit if the package is not installed
|
||||||
|
@ -46,6 +46,10 @@ RETVAL=0
|
||||||
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
if [ ! -d "/var/run/murano" ]; then
|
||||||
|
mkdir -p /var/run/murano
|
||||||
|
chown -R $SYSTEM_USER /var/run/murano
|
||||||
|
fi
|
||||||
echo -n "Starting $NAME: "
|
echo -n "Starting $NAME: "
|
||||||
daemon --user $SYSTEM_USER "$DAEMON --config-file=$CONFIG_FILE &>/dev/null & echo \$! > $PIDFILE"
|
daemon --user $SYSTEM_USER "$DAEMON --config-file=$CONFIG_FILE &>/dev/null & echo \$! > $PIDFILE"
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
|
@ -95,4 +99,4 @@ case "$1" in
|
||||||
echo $"Usage: $0 {start|stop|status|restart}"
|
echo $"Usage: $0 {start|stop|status|restart}"
|
||||||
exit 2
|
exit 2
|
||||||
esac
|
esac
|
||||||
exit $?
|
exit $?
|
||||||
|
|
|
@ -11,15 +11,15 @@ bind_host = 0.0.0.0
|
||||||
# Port the bind the server to
|
# Port the bind the server to
|
||||||
bind_port = 8082
|
bind_port = 8082
|
||||||
|
|
||||||
# Log to this file. Make sure the user has permissions to write to this file!
|
# Set up logging. Make sure the user has permissions to write to this file! To use syslog just set use_syslog parameter value to 'True'.
|
||||||
#log_file = /var/log/murano/murano-api.log
|
log_file = /var/log/murano/murano-api.log
|
||||||
use_syslog=True
|
use_syslog=False
|
||||||
syslog-log-facility=LOG_LOCAL0
|
syslog-log-facility=LOG_LOCAL0
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
#A valid SQLAlchemy connection string for the metadata database
|
#A valid SQLAlchemy connection string for the metadata database
|
||||||
#connection = mysql://root:password@localhost:3306/murano
|
#connection = mysql://root:password@localhost:3306/murano
|
||||||
connection = sqlite:///etc/murano/murano-api.sqlite
|
connection = sqlite:///murano.sqlite
|
||||||
|
|
||||||
#A boolean that determines if the database will be automatically created
|
#A boolean that determines if the database will be automatically created
|
||||||
auto_create = True
|
auto_create = True
|
||||||
|
|
|
@ -25,6 +25,7 @@ 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"
|
ETC_CFG_DIR="/etc/murano"
|
||||||
LOG_DIR="/var/log/murano/"
|
LOG_DIR="/var/log/murano/"
|
||||||
|
DB_DIR="/var/db/murano/"
|
||||||
SERVICE_CONFIG_FILE_PATH="$ETC_CFG_DIR/murano-api.conf"
|
SERVICE_CONFIG_FILE_PATH="$ETC_CFG_DIR/murano-api.conf"
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
|
@ -168,6 +169,14 @@ CLONE_FROM_GIT=$1
|
||||||
do
|
do
|
||||||
cp -f "$SERVICE_CONTENT_DIRECTORY/etc/murano/$file" "$ETC_CFG_DIR/$file.sample"
|
cp -f "$SERVICE_CONTENT_DIRECTORY/etc/murano/$file" "$ETC_CFG_DIR/$file.sample"
|
||||||
done
|
done
|
||||||
|
log "Creating $DB_DIR"
|
||||||
|
if [ ! -d "$DB_DIR" ]; then
|
||||||
|
mkdir -p $DB_DIR
|
||||||
|
if [ $? -ne 0 ];then
|
||||||
|
log "Can't create \"$DB_DIR\", exiting!!!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# searching for service executable in path
|
# searching for service executable in path
|
||||||
|
|
9
setup.sh
9
setup.sh
|
@ -23,6 +23,7 @@ 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"
|
ETC_CFG_DIR="/etc/murano"
|
||||||
LOG_DIR="/var/log/murano/"
|
LOG_DIR="/var/log/murano/"
|
||||||
|
DB_DIR="/var/db/murano/"
|
||||||
SERVICE_CONFIG_FILE_PATH="$ETC_CFG_DIR/murano-api.conf"
|
SERVICE_CONFIG_FILE_PATH="$ETC_CFG_DIR/murano-api.conf"
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
|
@ -146,6 +147,14 @@ CLONE_FROM_GIT=$1
|
||||||
do
|
do
|
||||||
cp -f "$SERVICE_CONTENT_DIRECTORY/etc/murano/$file" "$ETC_CFG_DIR/$file.sample"
|
cp -f "$SERVICE_CONTENT_DIRECTORY/etc/murano/$file" "$ETC_CFG_DIR/$file.sample"
|
||||||
done
|
done
|
||||||
|
log "Creating $DB_DIR"
|
||||||
|
if [ ! -d "$DB_DIR" ]; then
|
||||||
|
mkdir -p $DB_DIR
|
||||||
|
if [ $? -ne 0 ];then
|
||||||
|
log "Can't create \"$DB_DIR\", exiting!!!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# searching for service executable in path
|
# searching for service executable in path
|
||||||
|
|
Loading…
Reference in New Issue