systemd support for cinder-api
This commit is contained in:
parent
b49e5d3aa2
commit
01f62e023c
|
@ -20,7 +20,7 @@ DESC="OpenStack Cinder Api"
|
||||||
NAME=cinder-api
|
NAME=cinder-api
|
||||||
DAEMON=/usr/bin/cinder-api
|
DAEMON=/usr/bin/cinder-api
|
||||||
DAEMON_ARGS="--config-file=/etc/cinder/cinder.conf"
|
DAEMON_ARGS="--config-file=/etc/cinder/cinder.conf"
|
||||||
PIDFILE=/var/run/$NAME.pid
|
PIDFILE=/var/run/cinder/$NAME.pid
|
||||||
SCRIPTNAME=/etc/init.d/$NAME
|
SCRIPTNAME=/etc/init.d/$NAME
|
||||||
CINDER_USER=cinder
|
CINDER_USER=cinder
|
||||||
LOCK_DIR=/var/lock/cinder/
|
LOCK_DIR=/var/lock/cinder/
|
||||||
|
@ -28,8 +28,8 @@ LOCK_DIR=/var/lock/cinder/
|
||||||
# Exit if the package is not installed
|
# Exit if the package is not installed
|
||||||
[ -x $DAEMON ] || exit 0
|
[ -x $DAEMON ] || exit 0
|
||||||
|
|
||||||
mkdir -p ${LOCK_DIR}
|
mkdir -p ${LOCK_DIR} /var/run/cinder
|
||||||
chown ${CINDER_USER} ${LOCK_DIR}
|
chown ${CINDER_USER} ${LOCK_DIR} /var/run/cinder
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
|
@ -74,6 +74,12 @@ stop)
|
||||||
status)
|
status)
|
||||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||||
;;
|
;;
|
||||||
|
systemd-start)
|
||||||
|
do_start
|
||||||
|
;;
|
||||||
|
systemd-stop)
|
||||||
|
do_stop
|
||||||
|
;;
|
||||||
restart|force-reload)
|
restart|force-reload)
|
||||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||||
do_stop
|
do_stop
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
[Unit]
|
||||||
|
Description=OpenStack Cinder Api
|
||||||
|
Documentation=http://docs.openstack.org/
|
||||||
|
After=postgresql.service mysql.service keystone.service rabbitmq-server.service ntp.service network.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=cinder
|
||||||
|
Group=cinder
|
||||||
|
ExecStart=/etc/init.d/cinder-api systemd-start
|
||||||
|
ExecStop=/etc/init.d/cinder-api systemd-stop
|
||||||
|
PIDFile=/var/run/cinder/cinder-api.pid
|
||||||
|
Restart=on-failure
|
||||||
|
Type=forking
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Reference in New Issue