cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a GTK application to startup using systemd.

NRosa.1
Associate II

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.

3 REPLIES 3
Olivier GALLIEN
ST Employee

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

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Olivier GALLIEN
ST Employee

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

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Eldam
Senior

systemctl enable gatewayservice

could check with

systemctl status gatewayservice