1
# maas - txlongpoll service
3
# MAAS Provisioning Service txlongpoll
5
description "MAAS txlongpoll"
6
author "Andres Rodriguez <andres.rodriguez@canonical.com>"
8
start on filesystem and net-device-up and rabbitmq-server-running
13
env longpoll_user="maas_longpoll"
15
env longpoll_vhost="/maas_longpoll"
18
if ! /usr/sbin/rabbitmqctl list_user_permissions $longpoll_user 1>/dev/null 2>&1; then
19
longpoll_pass=`/bin/grep "password" /etc/maas/txlongpoll.yaml | cut -d'"' -f2`
20
/usr/sbin/rabbitmqctl add_user "$longpoll_user" "$longpoll_pass"
21
/usr/sbin/rabbitmqctl add_vhost "$longpoll_vhost"
22
/usr/sbin/rabbitmqctl set_permissions -p "$longpoll_vhost" "$longpoll_user" ".*" ".*" ".*"
26
# To add options to your daemon, edit the line below:
27
exec /usr/bin/twistd -n --uid=maas --gid=maas --pidfile=/run/maas-txlongpoll.pid --logfile=/dev/null txlongpoll --config-file=/etc/maas/txlongpoll.yaml