# rserver - RStudio main gateway process
#
#
# upstart docs: http://upstart.ubuntu.com/getting-started.html
#               http://manpages.ubuntu.com/manpages/karmic/man5/init.5.html
#
# (note that embedding a script and pre-start and post-start actions are supported)
#

start on runlevel [2345]
stop on runlevel [!2345]

expect fork

respawn

pre-start script
   # Make sure our AppArmor profile is loaded on boot
   # (see: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/577445)
   ${CMAKE_INSTALL_PREFIX}/extras/apparmor/apparmor-profile-load rstudio-server
end script

# run the server
exec ${CMAKE_INSTALL_PREFIX}/bin/rserver



