Linux upstart configuration

This commit is contained in:
María Arias de Reyna 2012-03-28 17:20:19 +02:00
parent 53aede83dc
commit 0093bc61cb
3 changed files with 52 additions and 0 deletions

9
linux/README Normal file
View File

@ -0,0 +1,9 @@
The files on this folder should be placed (with execute permissions) on your *nix with upstart capabilities to have osrm running as a daemon. You have to be root to do it.
Check the usr/bin/osrm file before proceed, as it will assume you have your code on /opt/Project-OSRM.
To give execute permission to this files, you can do:
# chmod +x $file
More info on upstart:
http://upstart.ubuntu.com/cookbook/

34
linux/etc/init/osrm.conf Normal file
View File

@ -0,0 +1,34 @@
# osrm
description "OpenRouteServiceMachine"
author "delawen <marias@emergya.com>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
respawn
# Essentially lets upstart know the process will detach itself to the background
expect fork
# Start the process
#script
# echo "Starting OSRM..."
# cd /home/devel/Project-OSRM/
# ./osrm-routed &
# echo "OSRM started"
# cd $pwd
#end script
exec osrm

9
linux/usr/bin/osrm Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
#This script assumes you have your OSRM compiled on the /opt/Project-OSRM folder. You should change that path to adecuate it to your needs.
echo "Starting OSRM..."
cd /opt/Project-OSRM/
./osrm-routed &
echo "OSRM started"
cd $pwd