Just managed to successfully run the API adapter on linux at the command prompt. Looking for a way to install it & run it as a windows service-like. that will restart on reboot or failure.
Any pointers?
Thanks,
Nic
Just managed to successfully run the API adapter on linux at the command prompt. Looking for a way to install it & run it as a windows service-like. that will restart on reboot or failure.
Any pointers?
Thanks,
Nic
You need to be logged in to reply to this post and participate in the Geotab Community discussions.
Hello @NChid-1960 ,
Thank you for asking your question in our community. I wanted to let you know I have contacted our SDK team to get their help here. I will let you know what I hear from them as soon as I do or have one of them jump in here.
Thank you for your patience while I look into this. Feel free to reach out with any other questions you may have in the meantime. We are here to help.
Have a good one!
Eishi FUN
Hey @NChid-1960 I got some comments from our team I wanted to share with you about this: In Linux, I believe you'd want to setup a Cron job to launch the application. Launching on reboot should be easy. But you'd need to put some sort of monitoring process in place to determine if/when the application crashes. That might include monitoring the running processes to see if the API Adapter stops, or looking at the log file. In the event of a crash, someone should take a look at the logs anyhow as the crash may be due to an unhandled exception that could just keep repeating.
The API Adapter already has resilience mechanisms in place to allow it to handle transient exceptions such as loss of connectivity to MyGeotab or the adapter database, timeouts, transaction failures requiring retries, etc. So crashes should not be a regular issue.
I also got some advice from Gemini that may be helpful here:
From Gemini
In Linux, the equivalent of a Windows service is a daemon. These are processes that run in the background, typically without direct user interaction, and provide services to other applications or the system itself.
Here's how you achieve the same persistence and automatic booting behavior in Linux:
1. Systemd (Modern Linux Systems)
Systemd is the most common init system and service manager in modern Linux distributions. It provides a robust way to manage services, including automatic startup, restart on failure, and dependency management.
2. Init Scripts (Older Linux Systems)
On older systems that don't use systemd, init scripts located in /etc/init.d/ or similar directories are used.
3. Other Process Supervisors
Besides systemd and init scripts, there are other process supervisors available:
Key Concepts for Persistence:
Example (Systemd):
Let's say you have an application called myapp. You would create a file named myapp.service in /etc/systemd/system/ with content similar to this:
Ini, TOML
[Unit] Description=My Application After=network.target [Service] ExecStart=/usr/bin/myapp Restart=always [Install] WantedBy=multi-user.target
Then, you would enable and start the service:
Bash
systemctl enable myapp.service systemctl start myapp.service
This ensures that myapp will start automatically at boot and restart if it crashes.
Remember to adjust the paths and commands according to your specific application. If you need more detailed instructions or have a specific application in mind, feel free to ask!