nova.initd 944 B

12345678910111213141516171819202122232425262728293031
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2016 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. description="Starts ${SVCNAME} service for OpenStack"
  5. command="/usr/bin/${SVCNAME} -- --config-file /etc/nova/nova.conf"
  6. pidfile=/var/run/nova/${SVCNAME}.pid
  7. required_files=/etc/nova/nova.conf
  8. start_stop_daemon_args="--quiet --user ${NOVA_USER:-nova}"
  9. if [ "$SVCNAME" == nova-compute ]; then
  10. required_files="${required_files} /etc/nova/nova-compute.conf"
  11. command="${command} --config-file /etc/nova/nova-compute.conf"
  12. fi
  13. depend() {
  14. use net
  15. }
  16. start_pre() {
  17. checkpath --directory --owner ${NOVA_USER:-nova}:${NOVA_GROUP:-nova} --mode 0775 ${NOVA_RUN:-/var/run/nova}
  18. checkpath --directory --owner ${NOVA_USER:-nova}:${NOVA_GROUP:-nova} --mode 0775 ${NOVA_RUN:-/var/lock/nova}
  19. }
  20. start() {
  21. ebegin "Starting ${SVCNAME}"
  22. start-stop-daemon -S -b -m -p ${pidfile} -q -u ${NOVA_USER:-nova} -x ${command}
  23. eend $?
  24. }