# shiny-server.conf

description "Shiny application server"

start on runlevel [2345]
stop on runlevel [016]

limit nofile 1000000 1000000

post-stop exec sleep 3

post-start script
    i=0
    while [ $i -lt 5 ]
    do
        pgrep "shiny-server" || exit 1
        sleep 1
        i=$((i+1))
    done
end script 
  
exec shiny-server --pidfile=/var/run/shiny-server.pid >> /var/log/shiny-server.log 2>&1

respawn limit 3 30

respawn
