44 lines
1.5 KiB
Plaintext
44 lines
1.5 KiB
Plaintext
description "Neutron VMware DVS plugin agent"
|
|
author "Igor Gajsin <igajsin@mirantis.com>"
|
|
|
|
start on runlevel [2345]
|
|
stop on runlevel [!2345]
|
|
|
|
chdir /var/run
|
|
|
|
respawn
|
|
respawn limit 20 5
|
|
limit nofile 65535 65535
|
|
|
|
pre-start script
|
|
for i in lock run log lib ; do
|
|
mkdir -p /var/$i/neutron
|
|
chown neutron /var/$i/neutron
|
|
done
|
|
end script
|
|
|
|
script
|
|
[ -x "/usr/bin/neutron-dvs-agent" ] || {
|
|
echo "$UPSTART_JOB" "ERROR: /usr/bin/neutron-dvs-agent not exists : exiting";
|
|
exit 0;
|
|
}
|
|
[ -r /etc/neutron/neutron.conf ] || {
|
|
echo "$UPSTART_JOB" "ERROR: Cloud not read /etc/neutron/neutron.conf: exiting";
|
|
exit 0;
|
|
}
|
|
DAEMON_ARGS="--config-file=/etc/neutron/neutron.conf"
|
|
CONFIG_FILE="<%= @agent_config %>"
|
|
USE_SYSLOG=""
|
|
USE_LOGFILE=""
|
|
NO_OPENSTACK_CONFIG_FILE_DAEMON_ARG=""
|
|
[ -r /etc/default/openstack ] && . /etc/default/openstack
|
|
[ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
|
|
[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
|
|
[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=<%= @agent_log %>"
|
|
[ -z "$NO_OPENSTACK_CONFIG_FILE_DAEMON_ARG" ] && DAEMON_ARGS="$DAEMON_ARGS --config-file=$CONFIG_FILE"
|
|
|
|
exec start-stop-daemon --start --chdir /var/lib/neutron \
|
|
--chuid neutron:neutron --make-pidfile --pidfile /var/run/neutron/$UPSTART_JOB.pid \
|
|
--exec /usr/bin/neutron-dvs-agent -- ${DAEMON_ARGS}
|
|
end script
|