0

I am looking for a simple way to start a simple .exe program on every bootup using rc.local (unless there's an easier way).

Currently, the executable program I want to run is located in: /home/pi/boot and is running properly using the sudo mono command.

I am trying to make this run at boot in the rc.local and I currently just have:

sudo /home/pi/boot/EXENAME.exe

of course I have the #!/bin/sh -e at the top of the file but not sure exactly how I should get this working.

Ghanima
  • 15,958
  • 17
  • 65
  • 125
Sharks
  • 33
  • 4

2 Answers2

1

.exe files will only run under mono. Prefix your file location with 'mono' in your script and it should work.

goobering
  • 10,750
  • 4
  • 40
  • 64
0

You should not be using rc.local assuming you are running a recent Raspbian which uses systemd. systemd will attempt to convert a well structured sysV script to a service, so it should still work.

An alternative for this case is to use cron.

You add commands to crontab by editing with crontab -e. E.g. I have @reboot sudo python /home/pi/shutdown_daemon.py in mine to run a program at boot.

There is a good tutorial at https://www.raspberrypi.org/documentation/linux/usage/cron.md

NOTE The first thing you should do (with ANY method) is run the program manually to ensure it actually works and the correct syntax.

Milliways
  • 62,573
  • 32
  • 113
  • 225