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?
Asked
Active
Viewed 1,511 times
1
-
Please see this: http://stackoverflow.com/questions/6016713/how-to-run-command-at-startup-in-linux – ChuckCottrill Nov 08 '13 at 21:29
-
Also here: http://unix.stackexchange.com/questions/19634/linux-equivalent-for-windows-startup, and here: http://stackoverflow.com/questions/7221757/run-automatically-program-on-startup-under-linux-ubuntu?rq=1 – ChuckCottrill Nov 08 '13 at 21:31
-
All the above answers do not seem to work on Arch linux – Gerharddc Nov 09 '13 at 07:07
-
1systemd is the way to go. You should write a service file for your application. It's well documented in the wiki : https://wiki.archlinux.org/index.php/Systemd#Writing_custom_.service_files – dna Nov 11 '13 at 08:39
-
If you have a desktop environment installed on your RPi there are easier solutions than systemd depending on your DE. Otherwise systemd is the solution you are looking for! – Nicolas Nov 11 '13 at 09:23
1 Answers
1
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

hawkmauk
- 11
- 3