2020-02-24 10:03 AM
Hi, how to add program to autostart in OpenSTLinux ?
I tried adding initialization script to /etc/init.d and creating .desktop file in ~/.config/autostart directory, but nothing works.
I will be very gratefull, if somebody could help me.
Solved! Go to Solution.
2020-05-11 02:09 AM
I found much easier solution to add graphical app to autostart on STM32MP157c-dk2:
1.Create start script in /usr/local/weston-start-at-startup directory with execution permissions.
Example script:
/home/root/app <- this is the proper graphical application
2. Optionally disable the current start_up_demo_launcher.sh by removing it's execution permisions.
I was looking for answer like that, that's shame that nobody propose this soloution earlier : /
2020-02-24 11:52 PM
OpenSTLinux is using systemd as the init process. You can have a look at how to write a systemd service. This service then can execute a script or program.
2020-02-25 03:44 AM
Hi, thanks for answer. I am trying to use this, but can't make it work. Maybe it is because i am trying to run graphical application ?
On Ubuntu creating .desktop file in ~/.config/autostart directory works well.
2020-02-25 05:55 AM
Hi, I am not using a graphical interface so I can't help you there. Maybe you have to execute your systemd service after weston has started (using the After=<systemd service> property). I hope someone else can help you with your problem :)
2020-02-26 12:50 AM
Hi,
place your script with execute permission into /etc/init.d direcotory and enable it by update-rc.d command.
BR,
Milan
2020-02-26 02:50 AM
2020-02-26 11:23 PM
You are right, I consulted - systemd is preferred on ST distribution.
Milan
2020-04-23 03:26 AM
Ok, i got the answer:
To add graphical app to autostart on STM32MP157c-dk2, you need to create systemd service with Weston Environment variables set properly and with properly set "After" statement in service.
Here is my startapp.service:
[Unit]
Description=Start app at startup
After=display-manager.service
[Service]
ExecStart=/etc/systemd/system/startapp.sh
[Install]
WantedBy=multi-user.target
Here is my startapp.sh script:
#!/bin/bash
. /etc/profile.d/weston_profile.sh
/home/root/app #this is the proper graphical application
Sourcing weston_profile.sh script sets all needed weston environment variables. Then you need to enable your service, by typing "systemctl enable startapp.service"
Hope it helps somebody :)
2020-05-11 02:09 AM
I found much easier solution to add graphical app to autostart on STM32MP157c-dk2:
1.Create start script in /usr/local/weston-start-at-startup directory with execution permissions.
Example script:
/home/root/app <- this is the proper graphical application
2. Optionally disable the current start_up_demo_launcher.sh by removing it's execution permisions.
I was looking for answer like that, that's shame that nobody propose this soloution earlier : /