NoobWithRaspberry wrote:Ce sujet a dû être traité beaucoup de fois. Cependant, les résultats sur internet me refroidissent un peu.
Repetition is good...
NoobWithRaspberry wrote:PS : Je suis débutant sur Linux

Welcome to gnu+linux!
NoobWithRaspberry wrote:
Il y a plusieurs façon différentes de lancer un script au démarrage, mais je veux être sûr de faire aucune erreur.
If you're new to linux, best to start with the simple reliable way, rc.local (systemd is for later...)
NoobWithRaspberry wrote:
Voilà, j'ai un petit programme bash qui surveille un fichier de log en continu. J'aimerai que ce script soit lancé à chaque fois que j'allume mon RaspberryPi 3.
Des idées ? Je vous remercie d'avance.
1) make a bin directory in /home/pi
2) put your script name.sh in your new bin directory and make it executable
Code: Select all
mv name.sh ~/bin/
chmod 0754 ~/bin/name.sh
3) edit /etc/rc.local with nano
Place the following lines above the 'exit 0' DO NOT remove the exit 0
Code: Select all
# autostart my script name.sh
su - pi -c "/home/pi/bin/name.sh &"
Reboot your PI
Voila!