Can't run traccar.service after update from 4.0 to 4.3

Daniel Osorio5 years ago

Hi there

Running ubuntu 16.04 Server and I have traccar 4.0 in a production environment running just fine, in my lab environment i unistalled 4.0 and installed 4.3 but I'm not able to run it as a service. If I run it manually with java -jar tracker-server.jar conf/traccar.xml it works fine, but if I do:

sudo systemctl start traccar.service it won't start ... I can't find any logs and if I run sudo systemctl status traccar.service and see:

 traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-02-04 15:22:30 PST; 1min 40s ago
  Process: 2238 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, status=203/EXEC)
 Main PID: 2238 (code=exited, status=203/EXEC)

Feb 04 15:22:30 ubuntu systemd[1]: Started traccar.
Feb 04 15:22:30 ubuntu systemd[1]: traccar.service: Main process exited, code=exited, status=203/EXEC
Feb 04 15:22:30 ubuntu systemd[1]: traccar.service: Unit entered failed state.
Feb 04 15:22:30 ubuntu systemd[1]: traccar.service: Failed with result 'exit-code'.

Any ideas on this matter?

Anton Tananaev5 years ago

Run it manually with the bundled JVM version.

Adrian Hodgson5 years ago

Just wondering as I will be doing something very similar in a day or two, have you changed /opt/traccar directory permissions to match any changes to allow the running as a non root user.

The content of the file should set the user for traccar to the one you want to run it as. Keep in mind, that the Traccar directory has, of course, to be readable and writable by that user.

[Service]
User=traccar
Group=traccar

Adrian

Daniel Osorio5 years ago

Thanks for the quick response... Will run it tomorrow and post the results

catruchos5 years ago

I am having exactly the same issue in a raspberry pi after updating to 4.3
How do I run it manually with the bundled JVM version?

Thanks a lot

Daniel Osorio5 years ago

Morning fellas

I tried to run it manually and had no luck with it...

My solution was to install a fresh copy of ubuntu 16.04.05 server .. didn't install java and installed traccar 4.3 then I ran the service and everything started smoothy:

 traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2019-02-05 06:24:30 PST; 5s ago
 Main PID: 37981 (java)
   CGroup: /system.slice/traccar.service
           └─37981 /opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml

Feb 05 06:24:30 ubuntu systemd[1]: Started traccar.

I don't know if having a java version running prior to installing traccar 4.3 was the issue but I solved it this way... Thanks for the support

Adrian Hodgson5 years ago

OK just done a remote update on a server and all went OK. For information Ubuntu 18.04 mysql database, run as a non root service and apache2 to provide a vhost so it can run ssl, and fail2ban.
After checking on another post this is what I did.
First stop all services traccar, mysql, apache2, fail2ban.

From within the /opt directory I renamed the traccar directory to traccarver4-2

Then I ran the Linux installer from a temp directory with sudo ./traccar.run
back in /opt directory it had now installed the new traccar directory.
sudo chown -R user:group traccar with user and group being my user and group setup.

Then sudo shutdown -r now let the system go down and then back up and service running fine.

[sudo] password for tesuser: 
● traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/traccar.service.d
           └─run-as-user.conf
   Active: active (running) since Tue 2019-02-05 15:00:02 GMT; 14min ago
 Main PID: 738 (java)
    Tasks: 33 (limit: 2017)
   CGroup: /system.slice/traccar.service
           └─738 /opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml
catruchos5 years ago

I tried to follow your instructions but is not working.
I tried to uninstall traccar, remove all directories and reinstall again but again is not working.

I get the following message

pi@raspberrypi ~/Descargas $ sudo systemctl status traccar.service
● traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/traccar.service.d
           └─run-as-user.conf
   Active: failed (Result: exit-code) since Wed 2019-02-06 19:19:31 CET; 4s ago
  Process: 1921 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, status=203/EXEC)
 Main PID: 1921 (code=exited, status=203/EXEC)

feb 06 19:19:31 raspberrypi systemd[1]: Started traccar.
feb 06 19:19:31 raspberrypi systemd[1]: traccar.service: Main process exited, code=exited, status=203/EXEC
feb 06 19:19:31 raspberrypi systemd[1]: traccar.service: Unit entered failed state.
feb 06 19:19:31 raspberrypi systemd[1]: traccar.service: Failed with result 'exit-code'.

any help would be welcome

catruchos5 years ago

I realized after making two times the same mistake, that I downloaded the wrong version of traccar, linux instead of ARM version for the raspberry pi.
Help for my future self.