New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Systemd Installation #2570
Comments
Does it have |
arch linux Systemd https://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples i think can you used traccar-other-3.8 and manual create service runing by traccar.sh First, create service file (/etc/systemd/system/traccar.service):
Now enable and run it:
|
Distros like debian use systemd but convert SysV init scripts into service files. Arch is purely systemd and has no init.d or rcX.d folders. All is done using systemd only. Traccar 3.7 worked OK if I fooled traccar.run into thinking it was on debian (by creating /etc/lsb-release) - otherwise only setting USE_SYSTEMD=true was ineffective. Perhaps if the /etc/systemd hierarchy is present the install should create systemd .service files only? |
yes, i think but i'm not test on arch linux i see docs only |
I have installed traccar-other-3.8, though it is not really an "installation" just unzipping the archive! It will start by running traccar.sh directly from /opt/traccar folder, but the systemd service file fails with no error messages, the journalctl says traccar started, and the file /tmp/traccar-pid still exists though no process present. I tried putting "cd /opt/traccar" into traccar.sh but still systemctl start fails. |
can you check more setting at https://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples |
I will check it out, though I have it working now, My current traccar.service file is:
(Perhaps I should mention there is an Arch user-contributed package for traccar but it is compile from source and i did not want to bother installing the compilation packages...) |
New version of Traccar is using YAJSW to run Traccar as a native service. I don't think it supports systemd. |
I don't have a traccar.sh in the traccar folder?
But as you can see no success :( I am on Archlinux. |
There are two options:
|
I went for option two and it works fine, thank you! |
The problem is that not all Linux distributions use systemd. |
Systemd is universal now [Redhat, CentOS, Fedora, Opensuse, Arch and so on], even in ubuntu from 16.04 onwards. IMHO it is better to have support for Systemd. |
Can I ask, for the sake of moving the PID file to its usual /var/run location can I just change the "/tmp" Java argument in traccar.sh to "/var/run" and relocate the PID file? |
@kirantpatil, I need some statistics. You are talking about latest versions of distros. There are many servers that run older versions or alternative distribution (especially in embedded world). @neilromig, you can try. It would probably move some other files there as well. |
Systemd adoption of major Linux distributions |
So, it was made default in 2015, and it's still not there for Gentoo. I think it's too early for full switch, but maybe it's a good idea to provide a separate installer for it. The main problem is that YAJSW doesn't support it. |
👍 for separate installer |
If somebody interested, here is systemd service to use with wrapper:
Exit code and timeout are adjusted to stop service correctly. wrapper has some useful features, like writing log, detecting deadlocks and others. |
@Abyss777 Getting following error on a systemd only OS (Archlinux)
It works fine after creating /etc/init.d - I guess this is a YAJSW bug(feature?) as it doesn't even touch the folder... |
You can probably change directory using http://yajsw.sourceforge.net/YAJSW%20Configuration%20Parameters.html |
I just created /etc/init.d to solve the issue. |
I am using your traccar.service code and it is running fine, without any error as below. Also observed that traccar file is present in
I am using ubuntu 16.04.1 LTS.
Please let me know if you want me to check further with systemd related issues.
|
@kirantpatil thanks for feedback.
|
I've made some modifications to run the service with another user. I'm sharing this to help :
|
@jzahraoui, thanks for sharing the information. |
I am trying to create a systemd drop-in, that would automatically restart the service after crash. The code above contains information I could use in my code, but judging from the fact that paths like /opt/traccar/conf/wrapper.conf no longer exist (at least in version: 4.2), it does not seem applicable any more. This is what I have:
..but it does not work. Systemd can see the file, but after I crash the service, it does not start back up. Could somebody please give me some pointers about how to make this work? |
.. more precisely, I am looking for values for these parameters: PIDFile (URI) I "think" the value for the ExecStart and ExecStop is the same and looks like this:
...but the PIDFile value I have no idea what that could be (running Ubuntu 14.04). |
Recent versions of Traccar use systemd by default. |
In both 3.7 and 3.8 installation fails initially because Arch Linux is systemd only and has no /etc/init.d so it would be good if traccar.run checked for systemd or prompted during install so it doesn't fail.
The text was updated successfully, but these errors were encountered: