I have installed osrm on my server in home/myname/osrm
if I manually start the process from beyond dir with osrm-routed data/map.osrm
it works fine, but unfortunately in foreground and after reboot if have to start it manually again.
I tried to install it as a service
[Unit]
Description = starts up the osrm service
After = network.target
[Service]
WorkingDirectory=/home/christian/osrm/
User=christian
ExecStart = /usr/local/bin/osrm-routed osrm-routed data/map.osrm
[Install]
WantedBy = multi-user.target
But when I start the service I get always error messages like this
[/etc/systemd/system/osrmstart.service:7] Executable path specifies a directory, ignoring: /usr/local/bin/osrm-routed/ osrm-routed data/map.osrm
Sep 01 14:03:46 ubuntu systemd[1]: osrmstart.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
What are I am doing wrong. I am very new to Ubuntu.
Thank you for answering to my question:
when i run:
file /usr/local/bin/osrm-routed
i get the following:
/usr/local/bin/osrm-routed: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=767f57fe712d25f03f1b2d18fd541d0253cd86d4, not stripped
i changed my osrmstart.service to:
[Unit]
Description = starts up the osrm service
After = network.target
[Service]
Type=simple
WorkingDirectory=/home/christian/osrm/
User=christian
ExecStart = /usr/local/bin/osrm-routed osrm-routed data/map.osrm
[Install]
WantedBy = multi-user.target
Now, if i first disable, then enable the osrmstart.service
and then start the service with sudo systemctl start osrmstart.service
:
I get no error - but the service is not starting and is not available.
Manually i can start the process when i navigate to my home dir
~/home/osrm
and then typing osrm-routed data/map.osrm
and Enter
this starts the process - the process is a server, waiting on localhost:port5000 for queries like
http://192.168.1.200:5000/route/v1/driving/11.57787,48.13877;11.52045,48.13969?steps=true&alternatives=true&
geometries=geojson
and returns the way from target to destination,but manually the process is running in forground.
I need the service running in background, also when rebooting the system. Maybe its only a type error - but i tried so many kinds of typings. Maybe my answer helps a bit more, for helping me. Thanks in advance.
Christian
which osrm-routed
I suppose you will get/usr/local/bin/osrm-routed
hence that will be the command to use in thesystemd
service file. And please remove the unnecessary spaces in your code!