Error when stopping server

Neil Romig7 years ago

I have started to get this error when I stop traccar service:

Sep 02 22:00:24 pinnacle systemd[1]: traccar.service: Failed with result 'exit-code'.
Sep 02 22:00:24 pinnacle systemd[1]: traccar.service: Unit entered failed state.
Sep 02 22:00:24 pinnacle systemd[1]: Stopped Traccar GPS tracking system.
Sep 02 22:00:24 pinnacle systemd[1]: traccar.service: Main process exited, code=exited, status=143/n/a
Sep 02 22:00:24 pinnacle traccar.sh[10706]: traccar stopped ...
Sep 02 22:00:24 pinnacle traccar.sh[10706]: traccar stoping ...
Sep 02 22:00:24 pinnacle systemd[1]: Stopping Traccar GPS tracking system...

Everything seems to be working, and the server starts up OK. What does the 143 status code mean? I am using traccar-other-3.14 on Arch linux.

Neil.

Anton Tananaev7 years ago

Looks like you are using some unofficial systemd integration. Have you tried official version? Are you sure server has enough resources?

Neil Romig7 years ago

I've been using the same startup script from traccar-other since upgrading to 3.8 (there were a few posts about systemd integration back then). I will try with the "official" version.
I am pretty sure the server has enough resources, at least it did yesterday when I was running 3.11...

Anton Tananaev7 years ago

You would need to check logs, but I'm not sure where your systemd script forward standard outputs.

Neil Romig7 years ago

I am just using traccar.sh as supplied in traccar-other and starting it from my own systemd .service file. I will investigate more tomorrow.

Neil Romig7 years ago

I ran it manually and here is the output from a start and stop of the server:

[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
INFO 9/3/17 6:44 AM: liquibase: Clearing database change log checksums
INFO 9/3/17 6:44 AM: liquibase: Successfully acquired change log lock
INFO 9/3/17 6:44 AM: liquibase: Successfully released change log lock
INFO 9/3/17 6:44 AM: liquibase: Successfully acquired change log lock
INFO 9/3/17 6:44 AM: liquibase: Reading from traccar.DATABASECHANGELOG
INFO 9/3/17 6:44 AM: liquibase: Reading from traccar.DATABASECHANGELOG
INFO 9/3/17 6:44 AM: liquibase: Successfully released change log lock
[main] INFO org.eclipse.jetty.util.log - Logging initialized @2734ms
[main] INFO org.eclipse.jetty.server.Server - jetty-9.2.22.v20170606
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@6fc6deb7{/api,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.t.w.@10db6131{/,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.ServerConnector - Started ServerConnector@24a62be{HTTP/1.1}{0.0.0.0:8082}
[main] INFO org.eclipse.jetty.server.Server - Started @4356ms
[Thread-11] INFO org.eclipse.jetty.server.ServerConnector - Stopped ServerConnector@24a62be{HTTP/1.1}{0.0.0.0:8082}
[Thread-11] INFO org.eclipse.jetty.server.handler.ContextHandler - Stopped o.t.w.@10db6131{/,null,UNAVAILABLE}
[Thread-11] INFO org.eclipse.jetty.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@6fc6deb7{/api,null,UNAVAILABLE}

The process exit status is 143.

UPDATE: looking back through my logs, it appears this always is the exit status and I just haven't noticed (oops!). Is 143 the normal exit status?

Neil.

Anton Tananaev7 years ago

Code 143 seems to correspond to SIGTERM, which means that you or someone else kills the process.

Neil Romig7 years ago

The traccar.sh script uses SIGTERM, and systemd also uses SIGTERM to stop the process so that explains that. Is there a better way to stop the server than sending SIGTERM?

Anton Tananaev7 years ago

No, it's perfectly normal way to stop it.

Neil Romig7 years ago

I have added an exit status check to my traccar.service file:

```[Unit]
Description=Traccar GPS tracking system
After=mariadb.service

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

[Install]
WantedBy=multi-user.target```

Problem solved (or worked around).

Neil.