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

 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

2

1 Answer

I see several issues here:

  1. Code syntax errors your code should look like this:

    [Unit] Description=starts up the osrm service After=network.target [Service] Type=daemon WorkingDirectory=/home/christian/osrm/ User=christian ExecStart=/usr/local/bin/osrm-routed data/map.osrm [Install] WantedBy=multi-user.target 
  2. /usr/local/bin/osrm-routed appears to be a directory not an executable file.

    • Run file /usr/local/bin/osrm-routed to determine for sure but I think you can know that by merely changing into it.
  3. Note: Don't know what type of program your trying to run so Type option could be Type=[simple|daemon|oneshot|forking|notify|idle]

More information:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy