Ligne 100 : |
Ligne 100 : |
| | | |
| == Raspbian Jessie et SystemD == | | == Raspbian Jessie et SystemD == |
| + | Depuis Raspbian Jessie, System 5 (mode de démarrage du système) à été remplacé par SystemD. Vous trouverez ci-dessous des informations traduites depuis le lien [http://nodered.org/docs/hardware/raspberrypi "Adding Autostart capability using SystemD"] (''nodered.org, anglais'') |
| + | |
| + | The preferred way to autostart Node-RED on Pi is to use the built in systemd capability. The pre-installed version does this by using a {{fname|nodered.service}} file and start and stop scripts. You may install these by running the following commands |
| + | |
| + | <syntaxhighlight lang="bash"> |
| + | sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/nodered.service -O /lib/systemd/system/nodered.service |
| + | sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-start -O /usr/bin/node-red-start |
| + | sudo wget https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/node-red-stop -O /usr/bin/node-red-stop |
| + | sudo chmod +x /usr/bin/node-red-st* |
| + | sudo systemctl daemon-reload |
| + | </syntaxhighlight> |
| + | |
| + | Info: These commands are run as root (sudo) - They download the three required files to their correct locations, make the two scripts executable and then reload the systemd daemon. |
| + | |
| + | Node-RED can then be started and stopped by using the commands {{fname|node-red-start}} and {{fname|node-red-stop}} (voyez le point précédent pour plus d'informations) |
| + | |
| + | To then enable Node-RED to run automatically at every boot and upon crashes |
| + | |
| + | <syntaxhighlight lang="bash"> |
| + | sudo systemctl enable nodered.service |
| + | </syntaxhighlight> |
| + | |
| + | It can be disabled by |
| + | |
| + | <syntaxhighlight lang="bash"> |
| + | sudo systemctl disable nodered.service |
| + | </syntaxhighlight> |
| + | |
| + | Systemd uses the {{fname|/var/log/system.log}} for logging. To filter the log use |
| + | |
| + | <syntaxhighlight lang="bash"> |
| + | sudo journalctl -f -u nodered -o cat |
| + | </syntaxhighlight> |
| + | |
| + | Il est également possible de modifier l'environnement de systemd et utiliser un proxy. Voyez ce [http://nodered.org/docs/hardware/raspberrypi lien dans la documentation de nodered.org]. |
| + | |
| | | |
− | Voir le point [http://nodered.org/docs/hardware/raspberrypi "Adding Autostart capability using SystemD" sur cette page]
| |
| | | |
| {{Rasp-Node-Red-TRAILER}} | | {{Rasp-Node-Red-TRAILER}} |