To elaborate the answer from @Milliways, using /etc/rc.local
is deprecated. Many distributions including Debian doesn't have it anymore. You should not use it. The reason is that it cannot be completely be emulated by systemd so there may be side effects which prevent programs to run properly. Please have a look at Compatibility with SysV. In particular the last sentence is important:
Note that there are some areas where systemd currently provides a certain amount of compatibility where we expect this compatibility to be removed eventually.
With using up to date Raspbian versions like Buster you will loose more and more support of rc.local
. So you should use a systemd unit file to start your programs. To be more flexible I suggest to run one service for each application. Here is a very simple Unit for the first application as entry point. Create a new service with:
rpi ~$ sudo systemctl --force --full edit myapp1.service
In the empty editor insert these statements, save them and quit the editor:
[Unit]
Description=My first application
After=multi-user.target
[Service]
ExecStart=/home/pi/app1
[Install]
WantedBy=multi-user.target
Enable and monitor it with:
rpi ~$ sudo systemctl enable --now myapp1.service
rpi ~$ systemctl status myapp1.service
I don't believe that this will run on the first attempt because many questions have to be answered about your applications but you do not tell us anything about them. Within a Unit file you have many options to define the needed environment so it is always possible to make the program running if it already runs on the command line. At least these questions have to be answered:
- Does the app only runs onetime, terminating after a short time, or does it stay in the background running as service?
- Because it is running on the command line, does it need tu run with user pi?
- Does it need environment settings like setting environment variables?
- Does it need other programs to be started before running the application?
- Are there conditions to meet before running the app, e.g. database access, network connections, mounted devices etc.?
- Is there any graphical output or only text output on a console?
- Maybe other conditions for your app?
If you like you can improve your question with needed information and I will adjust my answer.