"connected" and "disconnected" messages in the log refer to network connection status between devices and the server. They have nothing to do with service status.
I don't understand the question about cronjob. Why do you need it?
Because it seems sometimes the service is stopped. And i have to restart the service manually.
Well, you need to find out why it stops. Check wrapper log file.
That's the point. That the service will eventually stopped for one reason or another. So if we have some mechanisms to automatically restart the service when it stops, it would be great.
My wrapper log:
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper |
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper | ------------------------------------------------------------------------
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper | Advice:
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper | Usually when the Wrapper fails to start the JVM process, it is because
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper | of a problem with the value of the configured Java command. Currently:
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper | wrapper.java.command=java
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper | Please make sure that the PATH or any other referenced environment
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper | variables are correctly defined for the current environment.
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper | ------------------------------------------------------------------------
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper |
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper | The configured wrapper.java.command could not be found, attempting to launch anyway: java
INFO | jvm 5 | 2016/04/26 02:40:51 | wrapper | Launching a JVM...
ADVICE | wrapper | 2016/04/26 02:40:51 |
ADVICE | wrapper | 2016/04/26 02:40:51 | ------------------------------------------------------------------------
ADVICE | wrapper | 2016/04/26 02:40:51 | Advice:
ADVICE | wrapper | 2016/04/26 02:40:51 | Usually when the Wrapper fails to start the JVM process, it is because
ADVICE | wrapper | 2016/04/26 02:40:51 | of a problem with the value of the configured Java command. Currently:
ADVICE | wrapper | 2016/04/26 02:40:51 | wrapper.java.command=java
ADVICE | wrapper | 2016/04/26 02:40:51 | Please make sure that the PATH or any other referenced environment
ADVICE | wrapper | 2016/04/26 02:40:51 | variables are correctly defined for the current environment.
ADVICE | wrapper | 2016/04/26 02:40:51 | ------------------------------------------------------------------------
ADVICE | wrapper | 2016/04/26 02:40:51 |
FATAL | wrapper | 2016/04/26 02:40:52 | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up.
FATAL | wrapper | 2016/04/26 02:40:52 | There may be a configuration problem: please check the logs.
STATUS | wrapper | 2016/04/26 02:40:52 | <-- Wrapper Stopped
If server configured correctly, it doesn't stop. My demo servers run for months without any issues.
From your log it looks like there is some java issue. It's not installed correctly.
My server has been run for 10 days before the sudden stop. So I think it is correctly installed.
Is there any way that we can monitor the service status?
It's a standard system service, so you can use any tool that can monitor services. I'm sure there are some options available. I still think you need to find the root cause of the problem instead of fixing the symptom.
Yes, I do agree I've to also solve the root cause.
Statement 1:
Sometimes I got these messages in log:
Statement 2:
But in the last log I got this:
2016-04-26 00:42:10 INFO: [B3EE0660] disconnected
Statement 3:
Then I've to manually start the daemon
sudo /opt/traccar/bin/traccar start
.Question:
Actually I'm not sure if Statement 2 and Statement 3 are related.
Maybe the server stop logging because my device doesn't send any message. I'm expecting this because my prepaid credit is expired today. I don't expect to not be able to access the web interface. Hence I've to restart the daemon.
What are the context of connected and disconnected here?
Should I create a cronjob to monitor the daemon? If yes, how?