Page 1 sur 1

script au demarrage

Posté : sam. 18 avr. 2020 17:27
par eccoyo
salut salut,

J'ai un raspberry pi4 avec raspian lite (sans GUI)
j'aimerais lancer une appli au démarrage mais je n'y arrive pas.
quelle est votre méthode ?

merci d’avance

Re: script au demarrage

Posté : sam. 18 avr. 2020 17:50
par dyox

Re: script au demarrage

Posté : sam. 18 avr. 2020 19:06
par eccoyo
j'ai fais la methode systemd mais j'ai une erreur :

pi@raspberrypi:~ $ sudo journalctl -u auto_rx.service -f -n
-- Logs begin at Thu 2019-02-14 11:11:59 CET. --
Apr 18 19:00:12 raspberrypi systemd[1]: auto_rx.service: Main process exited, code=exited, status=200/CHDIR
Apr 18 19:00:12 raspberrypi systemd[1]: auto_rx.service: Failed with result 'exit-code'.
Apr 18 19:02:13 raspberrypi systemd[1]: auto_rx.service: Service RestartSec=2min expired, scheduling restart.
Apr 18 19:02:13 raspberrypi systemd[1]: auto_rx.service: Scheduled restart job, restart counter is at 261.
Apr 18 19:02:13 raspberrypi systemd[1]: Stopped auto_rx.
Apr 18 19:02:13 raspberrypi systemd[1]: Started auto_rx.
Apr 18 19:02:13 raspberrypi systemd[1837]: auto_rx.service: Changing to the requested working directory failed: No such file or directory
Apr 18 19:02:13 raspberrypi systemd[1837]: auto_rx.service: Failed at step CHDIR spawning /usr/bin/python: No such file or directory
Apr 18 19:02:13 raspberrypi systemd[1]: auto_rx.service: Main process exited, code=exited, status=200/CHDIR
Apr 18 19:02:13 raspberrypi systemd[1]: auto_rx.service: Failed with result 'exit-code'.


voici le cat du fichier .service :
[Unit]
Description=auto_rx
After=syslog.target

[Service]
ExecStart=/usr/bin/python /home/pi/radiosonde_auto_rx/auto_rx/auto_rx.py -t 0
Restart=always
RestartSec=120
WorkingDirectory=/home/pi/radiosonde_auto_rx/auto_rx/
User=pi
SyslogIdentifier=auto_rx

[Install]
WantedBy=multi-user.target


J'ai suivi un tuto pour faire cette install, ca devrait fonctionner mais.......non
https://github.com/projecthorus/radiosonde_auto_rx/wiki

Re: script au demarrage  [RESOLU]

Posté : mer. 22 avr. 2020 11:29
par eccoyo
RESOLU