How to start my application automatically after boot up / wake up

Hi
I created a systemd service for boot up and enabled it during create the image.
After build and flashed the image into eMMC and boot up, the app-start.sh script invoked most of time, but NOT every time. I checked the service status, it is enabled. I don’t know why the service does not invoked every boot up.

This is my service for boot up:

[Unit]
Description=my application
After=multi-user.target

[Service]
WorkingDirectory=/home/ion/Application
ExecStart=/home/ion/Application/app-start.sh boot
User=ion

[Install]
WantedBy=multi-user.target

This is code to enable the service during create the image using ansible

- name: Enable services
  systemd:
    name: "{{ item }}"
    enabled: yes
  loop:
    - ssh
    - systemd-networkd
    - network-manager
    - ion-application

How can fix it?
Thanks

CX

If you are using Ubuntu 18.04, you can use the “Start-up Applications” applet to set your script/app to start after booting. The applet wizard will guide you though the steps.

Hi mike_ev,
Thank you for your kind reply.
I am using Ubuntu 18.04 headless image. Would you please give me more info on using “Start-up Applications” applet to set your script/app to start after booting, such as reference link, etc.
Thanks

This is an Ubuntu topic and you can find several tutorials on the web. Search for “Start-up Applications over Command Line” and you should be pointed to some resources.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.