User Tools

Site Tools


run_program_at_boot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
run_program_at_boot [2016/09/07 11:31] walkeradminrun_program_at_boot [2017/01/31 16:40] walkeradmin
Line 9: Line 9:
 \\  \\ 
 \\  \\ 
-<color orange>We can use the .bashrc file to run a program at boot:</color>+<color blue>We can use the .bashrc file to run a program at boot:</color>
 \\  \\ 
     Ensure you are in the /home/pi folder and from the command line run:     Ensure you are in the /home/pi folder and from the command line run:
Line 16: Line 16:
 \\  \\ 
 \\  \\ 
-<color darkorange>At the end of the file add a line to run the Python script:</color>+<color blue>At the end of the file add a line to run the Python script:</color> 
 +\\  
 +    sudo python /home/pi/Python/UMD004.py & 
 +\\  
 +\\  
 +<color purple>Note:</color>
 \\  \\ 
-    sudo /home/pi/Python/UMD004.py & 
 \\  \\ 
 The <color Red>&</color> is important if your program does not end (say its a looping program) the <color Red>&</color> tells raspbian not to wait for the program to terminate before continuing. The <color Red>&</color> is important if your program does not end (say its a looping program) the <color Red>&</color> tells raspbian not to wait for the program to terminate before continuing.
 \\  \\ 
 \\  \\ 
 +\\ 
 +<color red>Warning!!!</color>
 +\\ 
 +This method means that the script will run on each login. So if after boot, a user logs in via an SSH session, the script will run again. This will cause issues, if this is a problem, try the Cron method [[run_program_at_boot_using_cron|here]].
 +\\ 
 +\\ 
 +
 +
run_program_at_boot.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1