29.09.2020, 12:33
Hallo Jens, hallo Leute,
wenn ich die SmartPi Services auf meinem Pi stoppen will, werden die Prozesse nicht beendet.
Habe gesehen, dass das Service folgendes implementiert:
Wenn ich die Binary händisch ausführe, werden die Prozesse gestoppt (aber danach wieder von systemd gestartet).
Was ist denn hier los?
LG
Daniel
wenn ich die SmartPi Services auf meinem Pi stoppen will, werden die Prozesse nicht beendet.
Code:
pi@smartpi:~ $ sudo service smartpi stop
pi@smartpi:~ $ ps -ef | grep smartpi
root 561 1 0 13:13 ? 00:00:00 su pi -c /usr/local/bin/smartpireadout
root 562 1 0 13:13 ? 00:00:00 su pi -c /usr/local/bin/smartpiserver
pi 663 562 0 13:13 ? 00:00:02 /usr/local/bin/smartpiserver
pi 665 561 1 13:13 ? 00:00:04 /usr/local/bin/smartpireadout
root 818 1 0 13:15 ? 00:00:00 su root -c /usr/local/bin/smartpimodbusserver
root 839 818 0 13:15 ? 00:00:00 /usr/local/bin/smartpimodbusserver
pi 967 788 0 13:19 pts/0 00:00:00 grep --color=auto smartpi
Habe gesehen, dass das Service folgendes implementiert:
Code:
[Unit]
Description=SmartPi
After=syslog.target network.target remote-fs.target nss-lookup.target systemd-journald-dev-log.socket
[Service]
Type=forking
ExecStart=/usr/local/bin/smartpi start
ExecStop=/usr/local/bin/smartpi stop
Restart=on-failure
StandardOutput=null
StandardError=null
[Install]
WantedBy=multi-user.target
Wenn ich die Binary händisch ausführe, werden die Prozesse gestoppt (aber danach wieder von systemd gestartet).
Code:
pi@smartpi:~ $ sudo /usr/local/bin/smartpi stop
/usr/local/bin/smartpi: 13: echo: echo: I/O error
node-red: no process found
smartpi_check_umts.sh: no process found
smartpimodbusserver: no process found
pi@smartpi:~ $ ps -ef | grep smartpi
root 550 1 0 13:25 ? 00:00:00 /bin/bash /usr/local/bin/smartpi_check_umts.sh
pi 799 754 0 13:26 pts/0 00:00:00 grep --color=auto smartpi
pi@smartpi:~ $ ps -ef | grep smartpi
root 550 1 0 13:25 ? 00:00:00 /bin/bash /usr/local/bin/smartpi_check_umts.sh
root 821 550 2 13:27 ? 00:00:00 su pi -c /usr/local/bin/smartpiserver
root 828 550 2 13:27 ? 00:00:00 su pi -c /usr/local/bin/smartpireadout
root 834 550 2 13:27 ? 00:00:00 su root -c /usr/local/bin/smartpimodbusserver
pi 843 821 1 13:27 ? 00:00:00 /usr/local/bin/smartpiserver
pi 851 828 2 13:27 ? 00:00:00 /usr/local/bin/smartpireadout
root 872 834 0 13:27 ? 00:00:00 /usr/local/bin/smartpimodbusserver
pi 880 754 0 13:27 pts/0 00:00:00 grep --color=auto smartpi
Was ist denn hier los?
LG
Daniel