New to GPS tracking and first time user of your server software. Just to say thanks.

Adrian Hodgson5 years ago

The above listed files are found in
/usr/lib/jvm/java-1_7_0/
/usr/lib/jvm/java-1_8_0/
etc.
All seem to be stored there

and from that point I am lost.

I will see if I have a book that covers it.

Adrian Hodgson5 years ago

This is my tracker.service file

[Unit]
Description=traccar

[Service]
Type=simple
WorkingDirectory=/opt/traccar
ExecStart= /opt/traccar/java -jar tracker-server.jar conf/traccar.xml
SyslogIdentifier=traccar
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

Is there something I should change it to?

Adrian

Adrian Hodgson5 years ago

Left it to late to edit previous file

Is there something I should change it to, should I be adding something like:
EnvironmentFile=-/usr/lib/jvm/java-1.7.0 or does it want
EnvironmentFile=-/opt/traccar

Adrian

Anton Tananaev5 years ago

Where did you get your service file from? And where did you get /opt/traccar/java specifically?

Anton Tananaev5 years ago

Obviously it doesn't exist.

Adrian Hodgson5 years ago

The manual install instructions at https://www.traccar.org/manual-installation/ say:
Install
Extract archive to any directory
Set up paths in the config file (traccar.xml)
Run using following command:

java -jar tracker-server.jar conf/traccar.xml

So I did, originally in /home/adrian/traccar directory and it would run manually.

From your posts about service start suggesting I look at setup.sh, everything was pointing towards /opt/traccar. So as root I went through the process of :
First running the 64 bit installer. It ran the process and provided the tracker.service file
I ran:
mv /opt/traccar/traccar.service /etc/systemd/system
chmod 664 /etc/systemd/system/traccar.service

As root I can remember needing to change a path as the 64 bit has a different directory format /jvm I think?

then
systemctl daemon-reload
systemctl enable traccar.service.

I deleted the 64 bit install by deleting /opt/traccar leaving just /opt

mkdir -p /opt/traccar to generate /opt/traccar again

I copied the file structure from /home/adrian/traccar to /opt/traccar by using
mkdir -p /opt/traccar and copying the files structure from one location to the other.

Then used chmod -R go+rX /opt/traccar

So /opt/traccar/ has a the same file structure as the manual install in it with only root permissions

And that is where I am at present. I can run it manually by starting a root consule in /opt/traccar and running
java -jar tracker-server.jar conf/traccar.xml

Then I can just leave the console and go back to other things, when I wish to stop it running I just use Control^C back in the root console and it exits.

As I say I am not a programmer.

Cheers

Adrian

Anton Tananaev5 years ago

You still haven't answered my question.

And where did you get /opt/traccar/java?

You don't need to be a "programmer", but you certainly need some basic knowledge of Linux and command line if you want to host your own server.

Adrian Hodgson5 years ago

Bit more information
the original traccer.service generated was as follows:

[Unit]
Description=traccar
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/traccar
ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml
SyslogIdentifier=traccar
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

and to try and match the manual install structure I changed it as above?

Adrian Hodgson5 years ago

Not sure what you mean by And where did you get /opt/traccar/java? the line is from the manual install instructions and is java -jar tracker-server.jar conf/traccar.xml

So the line I used in traccar.service is
ExecStart= /opt/traccar/java -jar tracker-server.jar conf/traccar.xml
Instead of
ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml for the 64 bit install.

Other than that I know not what you wish to know?

Anton Tananaev5 years ago

You need to provide correct path to Java. There is no java executable under /opt/traccar. You have to use something like:

/usr/lib/jvm/java-1.8.0/bin/java

... or whatever the correct path is.

Jake Stephens5 years ago

I don't know what flavour of Linux you're running on your 'thin client'.

If you're struggling with the manual install/compiling from source have you looked at the 'standard' Linux install? https://www.traccar.org/linux/ It's straight forward to get it working using this method, unless there's a reason you're using the manual method?

Adrian Hodgson5 years ago

From Anton

You need to provide correct path to Java. There is no java executable under /opt/traccar. You have to use something like:

/usr/lib/jvm/java-1.8.0/bin/java

... or whatever the correct path is.

OK I had assumed as manually it ran from /opt/traccar That as a service it would as well, I will look for files as you suggest, what is confusing to me is that in the manual install there is a lib directory and that has java type files in it. So in /opt/traccar/lib is a load of .jar files, I will continue to work on it but not tonight, I was trying until 3 am this morning I need sleep.

Thanks for you patience, before it runs out!

Adrian

Jake.

I am running an old 32 Bit of opensuse13.2 on a HP thin client, a HP T5730, the reason for the thin client is no fan, less than 30 watts of power consumption at full tilt, typically 10 watts and smaller than a packet of cornflakes. Unfortunately 64 bit versions even second hand can costing more than my laptop and when I am only planning to run 3 tracking devices on our own cars I believe the old HP would cope.

The web pages says there are 32 and 64 bit installs, but there are no 32 bit installs listed only 64 or the manual install. I have run the 64 bit on this computer, but a bit more modern 64 bit system with a couple of cores. Just something that would be wasteful for my personnel use.

Night all
Adrian

Anton Tananaev5 years ago

Why is that confusing? Traccar dependencies are in lib folder. It has absolutely nothing to do with Java runtime.

Adrian Hodgson5 years ago

It is to me, this will be the first time I have worked with java other than click on a button. :)

Adrian

Adrian Hodgson5 years ago

OK I am up and working as a service from the manual install files, thank you very much for your support and patience.

In case it helps some others here is the traccer.service file contents:

[Unit]
Description=traccar
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/traccar
ExecStart=/usr/lib/jvm/jre-1.8.0/bin/java -jar tracker-server.jar conf/traccar.xml
SyslogIdentifier=traccar
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

I am sure this can be improved on.

Adrian