Run script on boot
 
Notifications
Clear all

Run script on boot

5 Posts
3 Users
0 Reactions
2,739 Views
Posts: 34
Topic starter
(@rauco)
Eminent Member
Joined: 15 years ago
[#55689]

Is there a way to run a python script on FPP start besides using crontab?


4 Replies
MartinMueller2003
Posts: 7613
(@martinmueller2003)
Illustrious Member
Joined: 14 years ago

Linux (The OS used by FPP on a PI) has multiple ways to run a script at boot. You can even choose whether the script runs before or after FPP.


Reply
Posts: 34
Topic starter
(@rauco)
Eminent Member
Joined: 15 years ago

Can you tell me how to run a script after FPP boot?


Reply
MartinMueller2003
Posts: 7613
(@martinmueller2003)
Illustrious Member
Joined: 14 years ago

There are multiple ways. You can get a tutorial on them here: "https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/"

The problem is there are pluses and minuses for each method. The least intrusive is in the bashrc but FPP will most likely change that automatically so I suspect you will need to use the local system mechanisms.


Reply
Posts: 629
(@dkulp)
Honorable Member
Joined: 14 years ago

Do you need "At Boot" or "When FPPD is started"? If you have an Event Preset named "FPPD_STARTED", then that will be triggered when FPPD starts.

If you create a script named "/home/fpp/media/scripts/UserCallbackHook.sh", that script will get other events called. One of them would be with parameter "boot", but there others like preStart (before fppd starts), postStart (after fppd is started), pre/postStop, etc...


Reply
Share: