Starting an application with framebuffer on startup

Moderators: mdrjr, odroid

Starting an application with framebuffer on startup

Unread postby facotl » Sat Sep 09, 2017 2:48 am

Hello,

I want to use an Odroid C2 with a unique application that is launcjed on startup. Does someone have a clue ?

Thank you
facotl
 
Posts: 26
Joined: Tue Mar 24, 2015 5:06 pm
languages_spoken: english, francais
ODROIDs: C1

Re: Starting an application with framebuffer on startup

Unread postby odroid » Sat Sep 09, 2017 7:44 am

Which OS do you use?
User avatar
odroid
Site Admin
 
Posts: 25313
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Starting an application with framebuffer on startup

Unread postby zeta » Sat Sep 09, 2017 5:59 pm

If the question is how to launch the app at startup, one way to do so is by using systemd, with a service file like this:
Code: Select all
[Unit]
Description=YourAppDescription
After=network.target network-online.target YourAppOtherNeeded.target
 
[Service]
User=TheUserYourAppMustRunWith
WorkingDirectory=/Your/App/Working/Directory/
Environment="DISPLAY=:0.0"
ExecStart=/Your/App/Executable
 
[Install]
WantedBy=multi-user.target

In this example, the Environment variable was because it run on an X server (I had a specific target to launch it), so you won't need it here, but I kept it as an example if you need to pass environoment variable to your app. The "After" line here is waiting for network, but you can put whatever your app needs to be ready before starting there.

Then the service must be enable at startup with "systemctl enable yourapp.service". ("systemctl start yourapp.service" only starts it in the current session, not after reboot).

The cool thing with the systemd approach (or SysV if not available) is that it doesn't need a full desktop UI to be running before launching the app.

Does it answer you need ?
zeta
 
Posts: 8
Joined: Fri Apr 21, 2017 7:04 am
languages_spoken: english, french
ODROIDs: C2

Re: Starting an application with framebuffer on startup

Unread postby facotl » Sat Sep 23, 2017 8:57 pm

Hello,

Thanks, i will try asap.
facotl
 
Posts: 26
Joined: Tue Mar 24, 2015 5:06 pm
languages_spoken: english, francais
ODROIDs: C1


Return to General Chat

Who is online

Users browsing this forum: No registered users and 2 guests