Skip to main content
Visitor II
January 4, 2021
Question

Adding a GTK application to startup using systemd.

  • January 4, 2021
  • 3 replies
  • 1673 views

Hello,

I'm trying to add a python GTK application I created to the startup using systemd.

In order to do so I created the following gatewayservice.service file:

[Unit]
Description=Gateway service
Requires=graphical.target
After=graphical.target
 
[Service]
Type=idle
ExecStart=/bin/bash /usr/bin/gateway_service.sh
 
[Install]
WantedBy=multi-user.target

I am able to manually start the service using

systemctl start gatewayservice

But when I try to add it to startup and reboot it doesn't launch automatically.

I think I'm getting the requirements wrong in the service file but I'm not sure what to put instead.

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    January 11, 2021

    Hi @NRosa.1​ 

    Just a quick hint :

    The "Demo launcher" application delivered in Starter Package is a GTK application launched by default by systemd.

    Cross check how it's done.

    Olivier

    Technical Moderator
    January 11, 2021

    Other hint : change done in Linux FS may require "sync" command to be sure to be record on SDCard for following boot.

    Olivier

    Visitor II
    January 11, 2021

    systemctl enable gatewayservice

    could check with

    systemctl status gatewayservice