summaryrefslogtreecommitdiffstats
path: root/charms/trusty/contrail-webui/files/supervisor-webui.conf
blob: 37b8e254bb96e9151edd20ea98b9a767d05108a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
description     "Supervisord for VNC web-ui"

start on runlevel [2345]
stop on runlevel [016]
limit core unlimited unlimited

# Restart the process if it dies with a signal
# or exit code not given by the 'normal exit' stanza.
respawn

# Give up if restart occurs 10 times in 90 seconds.
respawn limit 10 90

pre-start script
    ulimit -s unlimited
    ulimit -c unlimited
    ulimit -d unlimited
    ulimit -v unlimited
    ulimit -n 4096
end script

script
    supervisord --nodaemon -c /etc/contrail/supervisord_webui.conf || true
    echo "supervisor-webui start failed...."
    (lsof | grep -i supervisord_webui.sock) || true
    pid=`lsof | grep -i supervisord_webui.sock | cut -d' ' -f3` || true
    if [ "x$pid" != "x" ]; then
        ps uw -p $pid
    fi
end script

pre-stop script
    supervisorctl -s unix:///tmp/supervisord_webui.sock stop all
    supervisorctl -s unix:///tmp/supervisord_webui.sock shutdown
    /usr/bin/supervisor_killall /etc/contrail/supervisord_webui_files
end script