Hi,
I thought about putting it under feature request but I am a long way off needing it.
I have several rather small Raspberry Pi programs that I would like to run from a single Pi.
I think it is only possible to run one program from editing the rc.local or bashrc file.
I could probably put all the code in on program but that would get messy.
I then wondered if it is possible to have a FC chart that calls other programs so the one program is started as normal but that one runs the others.
It would probably only need to run once on boot and then close as the other programs should be running then.
Regards,
Bob
Raspberry Pi program launcher
-
RGV250
- Posts: 362
- http://meble-kuchenne.info.pl
- Joined: Sat Mar 19, 2022 4:53 pm
- Has thanked: 36 times
- Been thanked: 40 times
-
mnfisher
- Valued Contributor
- Posts: 1763
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 148 times
- Been thanked: 831 times
Re: Raspberry Pi program launcher
Yes - a Linux (or origianally Unix) thing.
Normally - prog1 (for example) would run prog1 and wait for it to finish. The & runs it and returns immediately (so the program runs as a background task) - I think ps -al shows you all the tasks running ( or you can use top)
If you get the task id (using ps) - then you can kill background tasks using kill -9 task_id)
Martin
Normally - prog1 (for example) would run prog1 and wait for it to finish. The & runs it and returns immediately (so the program runs as a background task) - I think ps -al shows you all the tasks running ( or you can use top)
If you get the task id (using ps) - then you can kill background tasks using kill -9 task_id)
Martin
Re: Raspberry Pi program launcher
Hi,
I think I will need to do a bit of reading in the pub sometime. Years ago (before windows) I knew a lot of the DOS commands but Windows has made us lazy. It wouldn't be so bad if it worked all the time.
Bob
I think I will need to do a bit of reading in the pub sometime. Years ago (before windows) I knew a lot of the DOS commands but Windows has made us lazy. It wouldn't be so bad if it worked all the time.
Bob
-
chipfryer27
- Valued Contributor
- Posts: 1788
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 402 times
- Been thanked: 618 times
Re: Raspberry Pi program launcher
Hi
Far from a "guru" but wouldn't adding to .bashrc not cause them to run every time you logged in meaning the potential for multiple instances? I think I remember something about this on the RPi forum.
I'm assuming you are "headless", referring to FC code rather than "downloaded apps" so to speak, and want them all to automatically run at boot?
With the intro of "systemd" it makes things a bit more stable as it allows the OS to be fully operational before running your codes which may be better than editing rc.local
If you do a search along the lines of "running multiple programs at boot on RPi using systemd" you should get some ideas. Remember permissions too, they catch me out more times than I'll admit to....
Regards
Far from a "guru" but wouldn't adding to .bashrc not cause them to run every time you logged in meaning the potential for multiple instances? I think I remember something about this on the RPi forum.
I'm assuming you are "headless", referring to FC code rather than "downloaded apps" so to speak, and want them all to automatically run at boot?
With the intro of "systemd" it makes things a bit more stable as it allows the OS to be fully operational before running your codes which may be better than editing rc.local
If you do a search along the lines of "running multiple programs at boot on RPi using systemd" you should get some ideas. Remember permissions too, they catch me out more times than I'll admit to....
Regards