Shutdown startet Fhem neu ?

Begonnen von 1dz, 16 Februar 2021, 07:51:19

Vorheriges Thema - Nächstes Thema

1dz

Hallo zusammen,

vielleicht kann mir hier jemand helfen.
Habe Fhem seit Jahren auf einem Raspi 3 laufen.

Nun habe ich Fhem auf einem anderen Raspi 3 mal neu installiert.
Nur so, zum besseren Verständniss.

Ich bin dabei dieser Anleitung gefolgt:
https://wiki.fhem.de/wiki/Raspberry_Pi

Das hat auch alles funktioniert und führte zu einer Fhem Grundinstallation.
Wenn ich allerdings ,,shutdown" eintippe, dann ist fhem in ein paar Sekunden wieder aktiv.
Ich hatten dann die ganze Installation wiederholt, was leider das gleich Resultat zeigte.
Was habe ich falsch gemacht?
Wäre toll wenn mir jemand auf die Sprünge helfen könnte.

Gruß
Thomas

Hier ein Auszug aus meinem Log (verbose 5)


2021.02.15 21:21:15 5: Cmd: >shutdown<
2021.02.15 21:21:15 5: Starting notify loop for global, 1 event(s), first is SHUTDOWN
2021.02.15 21:21:15 5: createNotifyHash
2021.02.15 21:21:15 5: End notify loop for global
2021.02.15 21:21:15 0: Server shutdown
2021.02.15 21:21:15 4: WEB: /fhem?XHR=1&cmd=shutdown&fwcsrf=csrf_84122423712401&fw_id=49 / RL:20 / text/plain; charset=UTF-8 / Content-Encoding: gzip
/ Cache-Control: no-cache, no-store, must-revalidate

2021.02.15 21:21:16 5: Initializing Type Library:
2021.02.15 21:21:16 1: Including fhem.cfg
2021.02.15 21:21:16 5: Cmd: >attr global userattr cmdIcon devStateIcon:textField-long devStateStyle icon sortby webCmd webCmdLabel:textField-long widgetOverride<
2021.02.15 21:21:16 5: Cmd: >attr global autoload_undefined_devices 1<
2021.02.15 21:21:16 5: Cmd: >attr global logfile ./log/fhem-%Y-%m.log<
2021.02.15 21:21:16 5: Cmd: >attr global modpath .<
2021.02.15 21:21:16 5: Cmd: >attr global statefile ./log/fhem.save<
2021.02.15 21:21:16 5: Cmd: >attr global verbose 5<
2021.02.15 21:21:16 5: Cmd: >define WEB FHEMWEB 8083 global<
2021.02.15 21:21:16 5: Loading ./FHEM/01_FHEMWEB.pm
2021.02.15 21:21:17 3: WEB: port 8083 opened
2021.02.15 21:21:17 5: Cmd: >setuuid WEB 602abdc4-f33f-0f01-6dd6-edd70f6d8e798b5b<
2021.02.15 21:21:17 5: Cmd: >attr WEB stylesheetPrefix default<
2021.02.15 21:21:17 5: Cmd: >define Logfile FileLog ./log/fhem-%Y-%m.log fakelog<
2021.02.15 21:21:17 5: Loading ./FHEM/92_FileLog.pm
2021.02.15 21:21:17 5: Cmd: >setuuid Logfile 602abdc4-f33f-0f01-b0df-5212ea04387aaaa9<
2021.02.15 21:21:17 5: Cmd: >define autocreate autocreate<
2021.02.15 21:21:17 5: Loading ./FHEM/98_autocreate.pm
2021.02.15 21:21:17 5: Cmd: >setuuid autocreate 602abdc4-f33f-0f01-0469-d3d898e78f5d7375<
2021.02.15 21:21:17 5: Cmd: >attr autocreate filelog ./log/%NAME-%Y.log<
2021.02.15 21:21:17 5: Cmd: >define eventTypes eventTypes ./log/eventTypes.txt<
2021.02.15 21:21:17 5: Loading ./FHEM/91_eventTypes.pm
2021.02.15 21:21:17 2: eventTypes: loaded 2 lines from ./log/eventTypes.txt
2021.02.15 21:21:17 5: Cmd: >setuuid eventTypes 602abdc4-f33f-0f01-f792-554bbb1b2bcc5dcc<
2021.02.15 21:21:17 5: Cmd: >define initialUsbCheck notify global:INITIALIZED usb create<
2021.02.15 21:21:17 5: Loading ./FHEM/91_notify.pm
2021.02.15 21:21:17 5: Cmd: >setuuid initialUsbCheck 602abdc4-f33f-0f01-44d2-c7039da81263b05f<
2021.02.15 21:21:17 5: Cmd: >attr initialUsbCheck disable 1<
2021.02.15 21:21:17 5: Cmd: >define allowed_WEB allowed<
2021.02.15 21:21:17 5: Loading ./FHEM/96_allowed.pm
2021.02.15 21:21:17 5: Cmd: >setuuid allowed_WEB 602ad4ae-f33f-0f01-f7ea-621c3b67c96a51d8<
2021.02.15 21:21:17 5: Cmd: >attr allowed_WEB basicAuth a2Fsa2J1ZGVlOmthbGtidWRlMTkyNQ==<
2021.02.15 21:21:17 5: Cmd: >attr allowed_WEB validFor WEB<
2021.02.15 21:21:17 1: Including ./log/fhem.save
2021.02.15 21:21:17 5: Cmd: >setstate Logfile active<
2021.02.15 21:21:17 5: Cmd: >setstate WEB 2021-02-15 21:15:01 state Initialized<
2021.02.15 21:21:17 5: Cmd: >setstate allowed_WEB validFor:WEB<
2021.02.15 21:21:17 5: Cmd: >setstate allowed_WEB 2021-02-15 21:15:01 state validFor:WEB<
2021.02.15 21:21:17 5: Cmd: >setstate autocreate active<
2021.02.15 21:21:17 5: Cmd: >setstate eventTypes active<
2021.02.15 21:21:17 5: Cmd: >setstate global no definition<
2021.02.15 21:21:17 5: Cmd: >setstate initialUsbCheck disabled<
2021.02.15 21:21:17 5: Cmd: >setstate initialUsbCheck 2021-02-15 21:15:01 state disabled<
2021.02.15 21:21:17 5: Starting notify loop for global, 1 event(s), first is INITIALIZED
2021.02.15 21:21:17 5: createNotifyHash
2021.02.15 21:21:17 5: End notify loop for global
2021.02.15 21:21:17 0: Featurelevel: 6
2021.02.15 21:21:17 0: Server started with 7 defined entities (fhem.pl:23613/2021-01-25 perl:5.028001 os:linux user:fhem pid:638)
2021.02.15 21:21:21 4: Connection accepted from WEB_192.168.2.70_64388
2021.02.15 21:21:21 4: Connection accepted from WEB_192.168.2.70_64389
2021.02.15 21:21:21 5: GET /fhem?XHR=1&inform=type=status;filter=global;since=1613420474.8590002;fmt=JSON&fw_id=49×tamp=1613420478905 HTTP/1.1
Host: 192.168.2.57:8083
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0
Accept: */*
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Authorization: Basic a2Fsa2J1ZGVlOmthbGtidWRlMTkyNQ==
Connection: keep-alive
Referer: http://192.168.2.57:8083/fhem?detail=global&fw_id=49
2021.02.15 21:21:21 4: WEB_192.168.2.70_64388 GET /fhem?XHR=1&inform=type=status;filter=global;since=1613420474.8590002;fmt=JSON&fw_id=49×tamp=1613420478905; BUFLEN:0
2021.02.15 21:21:21 5: GET /fhem/FileLog_logWrapper?XHR=1&inform=type=status;filter=;since=1613420473.898;fmt=JSON&fw_id=146×tamp=1613420478905 HTTP/1.1
Host: 192.168.2.57:8083
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0
Accept: */*
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Authorization: Basic a2Fsa2J1ZGVlOmthbGtidWRlMTkyNQ==
Connection: keep-alive
Referer: http://192.168.2.57:8083/fhem/FileLog_logWrapper?dev=Logfile&type=text&file=fhem-2021-02.log
2021.02.15 21:21:21 4: WEB_192.168.2.70_64389 GET /fhem/FileLog_logWrapper?XHR=1&inform=type=status;filter=;since=1613420473.898;fmt=JSON&fw_id=146×tamp=1613420478905; BUFLEN:0
2021.02.15 21:21:30 4: Connection closed for WEB_192.168.2.70_64389: EOF
2021.02.15 21:21:30 4: Connection accepted from WEB_192.168.2.70_64408
2021.02.15 21:21:30 5: GET /fhem/FileLog_logWrapper?dev=Logfile&type=text&file=fhem-2021-02.log HTTP/1.1
Host: 192.168.2.57:8083
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Authorization: Basic a2Fsa2J1ZGVlOmthbGtidWRlMTkyNQ==
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0
2021.02.15 21:21:30 4: WEB_192.168.2.70_64408 GET /fhem/FileLog_logWrapper?dev=Logfile&type=text&file=fhem-2021-02.log; BUFLEN:0






KölnSolar

Hallo Thomas,
FHEM startet sich eher nicht selbst neu.
Hast Du evtl. irgendeinen restart-Mechanismus im OS eingebaut ? (Hab keine Ahnung, ob das sogar mittlerweile Standard ist) Schau ggfs. mal in die genutzte Installationsanleitung.

Grüße Markus
RPi3/2 buster/stretch-SamsungAV_E/N-RFXTRX-IT-RSL-NC5462-Oregon-CUL433-GT-TMBBQ-01e-CUL868-FS20-EMGZ-1W(GPIO)-DS18B20-CO2-USBRS232-USBRS422-Betty_Boop-EchoDot-OBIS(Easymeter-Q3/EMH-KW8)-PCA301(S'duino)-Deebot(mqtt2)-zigbee2mqtt

MadMax-FHEM

Ist auf Buster bzw. "seit systemd" so.

Gibt Threads im Forum dazu...

Musst du im "fhem-Start-Script": /etc/systemd/system schauen/ändern...

fhem beenden geht wohl nur per "service stop" auf der Console...

Gruß, Joachim
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

1dz

Markus, Joachim,

danke für Eure Antworten
Ich habe hier etwas gefunden:

https://forum.fhem.de/index.php?topic=109753.0

Werde es heute Abend mal ausprobieren.

Gruß
Thomas

1dz

Hab`s mal ausprobiert.

Ich habe in:


/etc/systemd/system/

in der Datei:

fhem.service

folgende Änderung gemacht:

Restart=always

auf

Restart=on-failure


Danach wird Fhem beendet.


Shutdown Restart

funktionierte danach allerdings nicht mehr. 
Also Raspi neu gebootet

Ich denke ich mache es wieder rückgängig, und beende dann Fhem, wenn nötig, über Putty.

Gruß
Thomas

Wernieman

Raspi (Linux) <> Windows ... man muß nicht immer gleich rebooten ...
Warum hast Du FHEm dann nicht per Conole gestartet?
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html