diff --git a/MANIFEST.in b/MANIFEST.in index d54488f41..e17f95995 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -13,4 +13,5 @@ include openstack-common.conf include muranoapi/db/migrate_repo/README include muranoapi/db/migrate_repo/migrate.cfg include muranoapi/db/migrate_repo/versions/*.sql +recursive-include etc * global-exclude *.pyc diff --git a/etc/init.d/murano-api-el6 b/etc/init.d/murano-api-el6 new file mode 100755 index 000000000..6a386e454 --- /dev/null +++ b/etc/init.d/murano-api-el6 @@ -0,0 +1,98 @@ +#!/bin/sh +# Copyright (c) 2013 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# Author: Igor Yozhikov +# +### BEGIN INIT INFO +# Provides: murano-api +# Required-Start: $network $local_fs $remote_fs $syslog +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OpenStack Murano API Server +# Description: This startup script launches murano-api service daemon. +### END INIT INFO +# chkconfig: 3 90 10 +# description: This startup script launches murano-api service daemon. +# config: /etc/murano/murano-api.conf, /etc/murano/murano-api-paste.ini +# +PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin +DESC="murano-api" +NAME=murano-api +DAEMON=$(which murano-api) +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/openstack-$NAME +SYSTEM_USER=root +CONFIG_FILE=/etc/murano/murano-api.conf +LOCKFILE=/var/lock/subsys/$NAME +# Exit if the package is not installed +[ -x $DAEMON ] || exit 5 + +# source function library +. /etc/init.d/functions + +RETVAL=0 + + +start() { + echo -n "Starting $NAME: " + daemon --user $SYSTEM_USER "$DAEMON --config-file=$CONFIG_FILE &>/dev/null & echo \$! > $PIDFILE" + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch $LOCKFILE + return $RETVAL +} + +stop() { + echo -n "Stopping $NAME: " + #killproc $DAEMON -TERM + killproc -p $PIDFILE $DAEMON + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f $LOCKFILE + return $RETVAL +} + +restart() { + stop + start +} + +rh_status() { + # run checks to determine if the service is running or use generic status + status $DAEMON +} + + +case "$1" in + start) + start + ;; + + stop) + stop + ;; + + restart) + restart + ;; + + status) + rh_status + ;; + *) + echo $"Usage: $0 {start|stop|status|restart}" + exit 2 +esac +exit $? \ No newline at end of file diff --git a/etc/murano-api-paste.ini b/etc/murano/murano-api-paste.ini similarity index 100% rename from etc/murano-api-paste.ini rename to etc/murano/murano-api-paste.ini diff --git a/etc/murano-api.conf b/etc/murano/murano-api.conf similarity index 92% rename from etc/murano-api.conf rename to etc/murano/murano-api.conf index 06d38c9c5..66a95b0a0 100644 --- a/etc/murano-api.conf +++ b/etc/murano/murano-api.conf @@ -1,9 +1,9 @@ [DEFAULT] # Show more verbose log output (sets INFO log level output) -verbose = True +verbose = False # Show debugging output in logs (sets DEBUG log level output) -debug = True +debug = False # Address to bind the server to bind_host = 0.0.0.0 @@ -12,12 +12,14 @@ bind_host = 0.0.0.0 bind_port = 8082 # Log to this file. Make sure the user has permissions to write to this file! -log_file = /tmp/murano-api.log +#log_file = /var/log/murano/murano-api.log +use_syslog=True +syslog-log-facility=LOG_LOCAL0 [database] #A valid SQLAlchemy connection string for the metadata database #connection = mysql://root:password@localhost:3306/murano -connection = sqlite:///murano.sqlite +connection = sqlite:///etc/murano/murano-api.sqlite #A boolean that determines if the database will be automatically created auto_create = True diff --git a/setup-centos.sh b/setup-centos.sh index 3b417cc7a..c4a430eee 100644 --- a/setup-centos.sh +++ b/setup-centos.sh @@ -164,9 +164,9 @@ CLONE_FROM_GIT=$1 fi # making smaple configs log "Making sample configuration files at \"$ETC_CFG_DIR\"" - for file in `ls $SERVICE_CONTENT_DIRECTORY/etc` + for file in `ls $SERVICE_CONTENT_DIRECTORY/etc/murano` do - cp -f "$SERVICE_CONTENT_DIRECTORY/etc/$file" "$ETC_CFG_DIR/$file.sample" + cp -f "$SERVICE_CONTENT_DIRECTORY/etc/murano/$file" "$ETC_CFG_DIR/$file.sample" done } diff --git a/setup.cfg b/setup.cfg index 39274a50e..b9cad108b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,14 +15,14 @@ [metadata] name = murano-api -version = 0.3 +version = 0.4 summary = Murano API description-file = README.rst license = Apache License, Version 2.0 author = Mirantis, Inc. author-email = murano-all@lists.openstack.org -home-page = htts://launchpad.net/murano +home-page = https://launchpad.net/murano classifier = Development Status :: 5 - Production/Stable Environment :: OpenStack diff --git a/setup.sh b/setup.sh index bd3e9429d..e93a6aee8 100644 --- a/setup.sh +++ b/setup.sh @@ -142,9 +142,9 @@ CLONE_FROM_GIT=$1 fi # making sample configs log "Making sample configuration files at \"$ETC_CFG_DIR\"" - for file in $(ls $SERVICE_CONTENT_DIRECTORY/etc) + for file in $(ls $SERVICE_CONTENT_DIRECTORY/etc/murano) do - cp -f "$SERVICE_CONTENT_DIRECTORY/etc/$file" "$ETC_CFG_DIR/$file.sample" + cp -f "$SERVICE_CONTENT_DIRECTORY/etc/murano/$file" "$ETC_CFG_DIR/$file.sample" done }