Reputation: 3166
I have a Raspberry Pi 2 with Raspbian. I am trying to start a Mono program called StartBrowser.exe automatically when the system boots. I added the following line to the /etc/rc.local file:
sudo mono /home/pi/Desktop/StartBrowser.exe
I also tried adding:
sudo /home/pi/Desktop/StartBrowser.exe
The program does not start on boot. When I run the same commands in the terminal the expected program starts. What do I need to do to start "StartBrowser.exe" on system boot ?
Upvotes: 1
Views: 3005
Reputation: 652
There are few steps to accomplish this:
sudo apt-get install mono-4.0-service
rc.local
file, just before exit 0
line this call:/usr/bin/mono-service -p:/directory/of/mono/app /directory/of/mono/app/app.exe
-p
switch is mandatory, otherwise no additional DLLs will be loaded.
Upvotes: 2
Reputation: 372
You can use "mono-service" to run programs in the background.
You can run your compiled code like so:
mono-service /home/pi/Desktop/StartBrowser.exe
By default, this creates a lockfile in /tmp. You can change this by using the -l: option. In this way your service is running in the background
Upvotes: 1