简体   繁体   中英

Arch linux startup application (script) Raspberry Pi

I want to use an RPi running Arch Linux to power an embedded device and I therefore need the RPi to launch a (Mono C#) application the moment after it has finished booting without the user having to do anything. I have seen tutorials of how to do this on Raspbian but not for Arch. Can anyone help please?

Systemd should do the trick. Create a service file for systemd:

vim /usr/lib/systemd/system/*yourApp*.service

The service file will need to contain at a minimum the following:

[Unit]
Description=My C# application

[Service]
ExecStart=<fully qualified path to your C# application>

[Install]
WantedBy=multi-user.target

You should then be able start the service using

systemctl start yourApp

you can quickly see if it worked or if there are any errors using

systemctl status yourApp

Once your happy that its working enable the service to start automatically using:

systemctl enable yourApp

use the link to the arch wiki provided by dna to learn more about more options for systemd files arch wiki

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM