Is there a way to start a systemd servcie

I have provisioned my application with an easy installer, so my application will start when the computer is restarted.

But each time when I have updates to my application, I have to load easy installer with micro usb, then install my application as bootable image.

Our requirement is only to use ethernet to update all software.

If I can create a systemd service to run my new image, when computer restarts, it can sutomatically run my servce and start my application. But it seems my Verdin IMX8MP didnot run my service.

is there a way to start a service? or is there a way to load my bootable image just through ethernet?

Thanks.

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!


Hello,

I understand you’re looking to start a systemd service automatically to run your application updates on a Verdin iMX8MP module, and you’re interested in updating your application over Ethernet.

To address your first point, if your systemd service is not starting as expected, ensure the service file is correctly configured and enabled. A typical systemd service file for your application might look something like this:

[Unit]
Description=My Application Service
After=network.target

[Service]
Type=simple
ExecStart=/path/to/your/application

[Install]
WantedBy=multi-user.target

After creating your service file (e.g., myapp.service) in /etc/systemd/system/, you can enable and start your service with:

# Enable your service to start on boot
sudo systemctl enable myapp.service

# Start your service immediately
sudo systemctl start myapp.service

If your service doesn’t start, check its status and logs for errors:

sudo systemctl status myapp.service
journalctl -u myapp.service

Regarding updating your application over Ethernet without using a micro USB each time, consider using TorizonCore with OSTree and Docker. TorizonCore supports OTA (Over-The-Air) updates, allowing you to update your application remotely. You can package your application in a Docker container and deploy it across your devices using the Torizon OTA system. This approach eliminates the need for physical access to the device for updates and leverages Ethernet for software deployment.

To transition to using TorizonCore with OTA updates for your application, you would:

  1. Package your application in a Docker container.
  2. Use the Torizon OTA web interface to manage and deploy your application updates to your devices.

This setup streamlines the update process, making it more efficient and less error-prone than manual updates via USB.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

How to Autorun Application at the Start up in Linux | Toradex Developer Center.


How did you like my response?

:+1: :-1:

Thanks alex.tx.

I am still reading documents, so far I still didn’t understand.

  1. so fat I am using torizoncore-builder to build a customized-bootable image, then use Easy Installer to flash the EMMC. Is there a commnd in torizoncore-builder that can directly copy the new files to EMMC, so no need for Easy Installer?. from what I am reading from OTA Updates, it seems there is a way, I still didnot know what command can do this.

  2. if torizoncore-builder can not do this, I want to use systemd service, here is my service:
    [Unit]
    Description=My Docker Service
    Requires=docker.service
    After=docker.service

[Service]
Restart=always
ExecStart=/usr/bin/docker run -e ACCEPT_FSL_EULA=1 --rm -it --name=qt6 -v /tmp:/tmp -v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore --device-cgroup-rule=‘c 199:* rmw’ --device-cgroup-rule=‘c 226:* rmw’ --network host 3855105b38f2 bash

[Install]
WantedBy=default.target

But so far it didnot work. I guess I maybe wrong on docker command.

Thanks.

P.S I am trying to use “torizoncore-builder deploy REF --remote-host …”, and assume my “torizoncore-builder build” command create “torizon.CUSTOM” direcotry, hwo to get the REF for this customized image? I guess this REF is the ostree ref.

Let’s separate the Torizon-Core and the application files and containers. Torizon-Core is a Linux-based OS image. To load a new OS image, you must use the Toradex Easy Installer or similar tools. It’s not possible to update all the files in the eMMC (RootFS) while the OS is running on the module, as many files are in use by the OS and cannot be replaced on-the-fly. Therefore, a special tool or framework is necessary for this task. However, you can deploy your application files, including containers. Solutions like OTA, which we recommend, or other similar solutions, can provide updates for your applications, containers, and/or the OS itself.
Please clarify exactly what exactly you are trying to achieve so that we can provide better assistance.

Thanks alex.tx.
I think now I used torizoncore-builder to combine my application image and torizon core iamge into one image. and I prefer this way to create my own bootable image.

I am trying to figure out how to use OTA updates. currently I have no clue. For example, how can I get a Torizon Cloud account?, I tried to register, but failed.; " *Device configured for using remote update", does this mean our Verdin IMX8MP need special configuration for remote update? I guess I need to see an exmaple of how to set up remote update.

Thanks.

Greetings @matty,

For example, how can I get a Torizon Cloud account?, I tried to register, but failed

Could you describe what you mean by “failed” here? What exactly did you encounter?

I guess I need to see an exmaple of how to set up remote update.

We have various articles covering remote updates here: Torizon Cloud Overview | Toradex Developer Center

Our quickstart guide also covers briefly how to perform an update. If you like we could also organize a call to showcase and talk about our update features and our cloud services in general if you feel that would be more helpful for your understanding.

Best Regards,
Jeremias

Thanks Jeremias.tx.

I think I have solved my problem.

I have figured out the correct way to start a systemd service, so right now I was able to restart my container when system reboots. For our future software update, we can just put a new container in the system then start a sytemd service.

OTA is nice, but I have not figured out how to do OTA update, it seems I can’t register as a cloud user, it seems I have to talk to the torizon cloud people.

Anyway. My problem is solved now.

Thanks.

OTA is nice, but I have not figured out how to do OTA update, it seems I can’t register as a cloud user, it seems I have to talk to the torizon cloud people.

Could you please tell us exactly what you’re experiencing here so that we can assist you.

Best Regards,
Jeremias