diff options
Diffstat (limited to 'sys-cluster/nova/files/nova.initd')
-rw-r--r-- | sys-cluster/nova/files/nova.initd | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sys-cluster/nova/files/nova.initd b/sys-cluster/nova/files/nova.initd new file mode 100644 index 000000000000..7d679ed95fc9 --- /dev/null +++ b/sys-cluster/nova/files/nova.initd @@ -0,0 +1,30 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Starts ${SVCNAME} service for OpenStack" + +command="/usr/bin/${SVCNAME} -- --config-file /etc/nova/nova.conf" +pidfile=/var/run/nova/${SVCNAME}.pid +required_files=/etc/nova/nova.conf +start_stop_daemon_args="--quiet --user ${NOVA_USER:-nova}" +if [ "$SVCNAME" == nova-compute ]; then + required_files="${required_files} /etc/nova/nova-compute.conf" + command="${command} --config-file /etc/nova/nova-compute.conf" +fi + + +depend() { + use net +} + +start_pre() { + checkpath --directory --owner ${NOVA_USER:-nova}:${NOVA_GROUP:-nova} --mode 0775 ${NOVA_RUN:-/var/run/nova} + checkpath --directory --owner ${NOVA_USER:-nova}:${NOVA_GROUP:-nova} --mode 0775 ${NOVA_RUN:-/var/lock/nova} +} + +start() { + ebegin "Starting ${SVCNAME}" + start-stop-daemon -S -b -m -p ${pidfile} -q -u ${NOVA_USER:-nova} -x ${command} + eend $? +} |