diff --git a/linux/README b/linux/README new file mode 100644 index 000000000..82d86c58b --- /dev/null +++ b/linux/README @@ -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/ diff --git a/linux/etc/init/osrm.conf b/linux/etc/init/osrm.conf new file mode 100644 index 000000000..6ac036efa --- /dev/null +++ b/linux/etc/init/osrm.conf @@ -0,0 +1,34 @@ +# osrm + +description "OpenRouteServiceMachine" +author "delawen " + +# 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 + diff --git a/linux/usr/bin/osrm b/linux/usr/bin/osrm new file mode 100644 index 000000000..12b5259c2 --- /dev/null +++ b/linux/usr/bin/osrm @@ -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 +