Bonjour à tous,
Je m'arrache un peu les cheveux en ce moment... Voilà j'ai créé un programme en C, c'est un logger qui va enregistrer dans un fichier les trames reçu sur un port USB. Ce programme fonctionne très bien quand je le lance manuellement, car mon fichier de log est bien créé et le fichier PID est bien présent dans /var/run.

MAIS ! Pas possible de le lancer avec systemctl...

Voici le fichier service (/etc/systemd/system/SensIndoor@.service) :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
[Unit]
Description=SensIndoor Logger
 
[Service]
Type=forking
ExecStart=/usr/local/bin/SensIndoor_Logger %I
PIDFile=/var/run/SensIndoor.pid
 
[Install]
WantedBy=multi-user.target
pour le lancer je fais :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
systemctl start SensIndoor@ttyACM0.service
Mais au final j’obtiens un message d'erreur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
root@raspberrypi:/opt/LINUX_SensIndoor_Logger# systemctl status SensIndoor@ttyACM0.service
● SensIndoor@ttyACM0.service - SensIndoor Logger
   Loaded: loaded (/etc/systemd/system/SensIndoor@.service; disabled)
   Active: failed (Result: signal) since Thu 2016-12-01 16:48:04 UTC; 56s ago
  Process: 5153 ExecStart=/usr/local/bin/SensIndoor_Logger %I (code=killed, signal=SEGV)
 
Dec 01 16:47:58 raspberrypi SensIndoor_Logger[5153]: Starting program with parameter ttyACM0
Dec 01 16:47:58 raspberrypi SensIndoorDaemon[5153]: Daemon starting up
Dec 01 16:47:58 raspberrypi SensIndoorDaemon[5153]: Daemon running
Dec 01 16:47:58 raspberrypi SensIndoor_Logger[5153]: SensIndoorDaemon: Daemon starting up
Dec 01 16:47:58 raspberrypi SensIndoor_Logger[5153]: SensIndoorDaemon: Daemon running
Dec 01 16:48:04 raspberrypi systemd[1]: SensIndoor@ttyACM0.service: control process exited, code=killed status=11
Dec 01 16:48:04 raspberrypi systemd[1]: Failed to start SensIndoor Logger.
Dec 01 16:48:04 raspberrypi systemd[1]: Unit SensIndoor@ttyACM0.service entered failed state.
root@raspberrypi:/opt/LINUX_SensIndoor_Logger#
Je suis sur un raspberry pi 3 avec la distribution raspbian jessie.

Est ce que quelqu’un comprend le problème ??

Merci