FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: maddhin am 15 Oktober 2017, 07:45:44

Titel: Shutdown+restart: FHEM startet nicht
Beitrag von: maddhin am 15 Oktober 2017, 07:45:44
Hi,

hierzu gibt es ja schon einige Threads aber nichts scheint zu passen:

wenn ich ein shutdown restart mache, funktioniert der shutdown aber dann kommt kein restart.

Log:
2017.10.15 13:24:38 3: FHEMWEB WEB CSRF error: csrf_461320285624824 ne csrf_418035413230496 for client WEB_192.168.2.20_53898. For details see the csrfToken FHEMWEB attribute.
2017.10.15 13:24:58 0: Server shutdown
2017.10.15 13:24:58 1: Shutdown executed
2017.10.15 13:25:22 1: Including /etc/fhem.cfg
2017.10.15 13:25:22 1: PERL WARNING: Subroutine myUtils_Initialize redefined at /usr/share/fhem/FHEM/99_MyUtils.pm line 15, <$fh> line 4.
2017.10.15 13:25:22 1: PERL WARNING: Subroutine movingAverage redefined at /usr/share/fhem/FHEM/99_MyUtils.pm line 27, <$fh> line 4.
2017.10.15 13:25:22 1: PERL WARNING: Subroutine myAverage redefined at /usr/share/fhem/FHEM/99_MyUtils.pm line 81, <$fh> line 4.
2017.10.15 13:25:22 3: telnetPort: port 7072 opened
2017.10.15 13:25:22 3: WEB: port 8083 opened
2017.10.15 13:25:22 3: WEBphone: port 8084 opened
2017.10.15 13:25:22 3: WEBtablet: port 8085 opened
2017.10.15 13:25:23 2: eventTypes: loaded 404 events from /var/lib/fhem/eventTypes.txt
2017.10.15 13:25:24 3: TABLETUI: new ext defined infix:ftui/: dir:/usr/share/fhem/www/tablet:
2017.10.15 13:25:24 3: Registering HTTPSRV TABLETUI for URL /ftui   and assigned link ftui/ ...
2017.10.15 13:25:24 2: ESPEasy espBridge: Opening bridge port tcp/8383 (v1.33)
2017.10.15 13:25:24 3: espBridge: port 8383 opened
2017.10.15 13:25:25 1: Including /var/lib/fhem/fhem.save
2017.10.15 13:25:25 3: Plex: multicast server discovery started
2017.10.15 13:25:25 3: Plex: broadcast server discovery started
2017.10.15 13:25:25 3: Plex: multicast client discovery started
2017.10.15 13:25:25 3: Plex: broadcast client discovery started
2017.10.15 13:25:25 3: Plex: pht client discovery started
2017.10.15 13:25:25 3: Plex: timeline listener started
2017.10.15 13:25:25 1: usb create starting
2017.10.15 13:25:25 3: Probing CUL device /dev/ttyAMA0
2017.10.15 13:25:25 3: Can't open /dev/ttyAMA0: Permission denied
2017.10.15 13:25:25 1: usb create end
2017.10.15 13:25:25 3: Opening mqtt device 127.0.0.1:1883
2017.10.15 13:25:25 3: mqtt device opened
2017.10.15 13:25:25 2: SecurityCheck:  WEB,WEBphone,WEBtablet has no associated allowed device with basicAuth. telnetPort has no associated allowed device with password/globalpassword.  Restart FHEM for a new check if the problem is fixed, or set the global attribute motd to none to supress this message.
2017.10.15 13:25:25 0: Featurelevel: 5.8
2017.10.15 13:25:25 0: Server started with 53 defined entities (fhem.pl:15182/2017-10-03 perl:5.026001 os:linux user:fhem pid:508)


Ich weiß nicht, ob diese WEB token Sache etwas damit zu tun haben könnte.

Ich habe Arch Linux und muss nach dem shutdown dann FHEM manuell mit systemd service "systemctl start fhem.service" neu starten. Fhem und System ist auf dem aktuellsten Stand.

Hat jemand eine gute Idee wie ich herausfinden kann woran es liegt und wie ich shutdown+restart zu Laufen bekomme?
Titel: Antw:Shutdown+restart: FHEM startet nicht
Beitrag von: CoolTux am 15 Oktober 2017, 08:14:07
Du machst nach einem restart aber schon ein refresh (F5) des Browsers?
Titel: Antw:Shutdown+restart: FHEM startet nicht
Beitrag von: maddhin am 15 Oktober 2017, 08:19:47
:) Fhem startet nicht nach dem shutdown! D.h. der refresh bringt nur eine leere Seite...

"systemctl status fhem" zeigt dann Fhem auch als dead an...
Titel: Antw:Shutdown+restart: FHEM startet nicht
Beitrag von: Frank_Huber am 15 Oktober 2017, 08:43:33
Also deinem log nach zu urteilen startet FHEM...

Gesendet von meinem S3_32 mit Tapatalk

Titel: Antw:Shutdown+restart: FHEM startet nicht
Beitrag von: CoolTux am 15 Oktober 2017, 08:52:01
https://wiki.fhem.de/wiki/FHEM_startet_nicht_-_Tipps_zur_Fehlersuche

Schau Mal hier
Titel: Antw:Shutdown+restart: FHEM startet nicht
Beitrag von: maddhin am 15 Oktober 2017, 09:37:16
klar, FHEM startet, nachdem man es MANUELL startet aber FHEM macht keinen Restart. Das Log war "Shutdown restart" und dann manueller Neustart... Qasi als Info, dass es keine brauchbare Fehlermeldung gibt...

Werde mir den Link ansehen, danke!
Titel: Antw:Shutdown+restart: FHEM startet nicht (telnet port)
Beitrag von: maddhin am 15 Oktober 2017, 09:53:08
OK, der neue Debug Parameter hat geholfen:

ein /usr/bin/fhem.pl -d /etc/fhem.cfg bringt:


2017.10.15 15:44:48 5: Loading /usr/share/fhem/FHEM/99_MyUtils.pm
2017.10.15 15:44:48 1: PERL WARNING: Prototype after '@' for main::myUtils_PM10_to_usAQI : @_ at /usr/share/fhem/FHEM/99_MyUtils.pm line 110.
2017.10.15 15:44:48 1: PERL WARNING: "my" variable $I masks earlier declaration in same scope at /usr/share/fhem/FHEM/99_MyUtils.pm line 163.
2017.10.15 15:44:48 1: PERL WARNING: Prototype after '@' for main::myUtils_PM25_to_usAQI : @_ at /usr/share/fhem/FHEM/99_MyUtils.pm line 175.
2017.10.15 15:44:48 1: PERL WARNING: "my" variable $I masks earlier declaration in same scope at /usr/share/fhem/FHEM/99_MyUtils.pm line 228.
2017.10.15 15:44:48 5: Loading /usr/share/fhem/FHEM/99_SUNRISE_EL.pm
2017.10.15 15:44:48 5: Loading /usr/share/fhem/FHEM/99_Utils.pm
2017.10.15 15:44:48 5: Initializing Type Library:
2017.10.15 15:44:48 1: Including /etc/fhem.cfg
2017.10.15 15:44:48 5: Cmd: >attr global userattr cmdIcon devStateIcon devStateStyle genericDeviceType:security,ignore,switch,outlet,light,blind,thermometer,thermostat,contact,garage,window,lock homebridgeMapping:textField-long icon siriName sortby webCmd webCmdLabel:textField-long widgetOverride<
2017.10.15 15:44:48 5: Cmd: >attr global autoload_undefined_devices 1<
2017.10.15 15:44:48 5: Cmd: >attr global logfile /var/lib/fhem/fhem-%Y-%m.log<
2017.10.15 15:44:48 5: Cmd: >attr global modpath /usr/share/fhem<
2017.10.15 15:44:48 5: Loading /usr/share/fhem/FHEM/99_MyUtils.pm
2017.10.15 15:44:48 1: PERL WARNING: Subroutine myUtils_Initialize redefined at /usr/share/fhem/FHEM/99_MyUtils.pm line 15, <$fh> line 4.
2017.10.15 15:44:48 1: PERL WARNING: Subroutine movingAverage redefined at /usr/share/fhem/FHEM/99_MyUtils.pm line 27, <$fh> line 4.
2017.10.15 15:44:48 1: PERL WARNING: Subroutine myAverage redefined at /usr/share/fhem/FHEM/99_MyUtils.pm line 81, <$fh> line 4.
2017.10.15 15:44:48 1: PERL WARNING: Prototype after '@' for main::myUtils_PM10_to_usAQI : @_ at /usr/share/fhem/FHEM/99_MyUtils.pm line 110, <$fh> line 4.
2017.10.15 15:44:48 1: PERL WARNING: "my" variable $I masks earlier declaration in same scope at /usr/share/fhem/FHEM/99_MyUtils.pm line 163, <$fh> line 4.
2017.10.15 15:44:48 1: PERL WARNING: Subroutine myUtils_PM10_to_usAQI redefined at /usr/share/fhem/FHEM/99_MyUtils.pm line 110, <$fh> line 4.
2017.10.15 15:44:48 1: PERL WARNING: Prototype after '@' for main::myUtils_PM25_to_usAQI : @_ at /usr/share/fhem/FHEM/99_MyUtils.pm line 175, <$fh> line 4.
2017.10.15 15:44:48 1: PERL WARNING: "my" variable $I masks earlier declaration in same scope at /usr/share/fhem/FHEM/99_MyUtils.pm line 228, <$fh> line 4.
2017.10.15 15:44:48 1: PERL WARNING: Subroutine myUtils_PM25_to_usAQI redefined at /usr/share/fhem/FHEM/99_MyUtils.pm line 175, <$fh> line 4.
2017.10.15 15:44:48 5: Cmd: >attr global motd SecurityCheck:

WEB,WEBphone,WEBtablet has no associated allowed device with basicAuth.
telnetPort has no associated allowed device with password/globalpassword.

Restart FHEM for a new check if the problem is fixed,
or set the global attribute motd to none to supress this message.
<
2017.10.15 15:44:48 5: Cmd: >attr global statefile /var/lib/fhem/fhem.save<
2017.10.15 15:44:48 5: Cmd: >attr global updateInBackground 1<
2017.10.15 15:44:48 5: Cmd: >attr global verbose 3<
2017.10.15 15:44:48 5: Cmd: >define telnetPort telnet 7072 global<
2017.10.15 15:44:48 5: Loading /usr/share/fhem/FHEM/98_telnet.pm
2017.10.15 15:44:48 1: telnetPort: Can't open server port at 7072: Address already in use. Exiting.


D.h. es gibt wohl einen Konflikt beim Telnet port.

Mit systemd startet FHEM aber ohne Probleme... Weiß jemand wie das zu lösen ist?
Titel: Antw:Shutdown+restart: FHEM startet nicht
Beitrag von: Deudi am 15 Oktober 2017, 10:54:34
Mal gesucht?

https://forum.fhem.de/index.php?topic=54271.0 (https://forum.fhem.de/index.php?topic=54271.0)

https://forum.fhem.de/index.php?topic=25706.0 (https://forum.fhem.de/index.php?topic=25706.0)
Titel: Antw:Shutdown+restart: FHEM startet nicht
Beitrag von: maddhin am 15 Oktober 2017, 12:14:35
Gesucht, ja, aber offensichtlich nach dem Falschem! Ich hatte nicht verstanden, dass das Problem bei systemd ist. Sorry.

Das How-to https://forum.fhem.de/index.php/topic,54271.0.html (https://forum.fhem.de/index.php/topic,54271.0.html) hat das Problem gelöst.

Es fehlte:

Restart=always
RestartSec=5


in der fhem.service.

Lieben Dank für die Hilfe!
Titel: Antw:Shutdown+restart: FHEM startet nicht
Beitrag von: t0m am 15 Oktober 2017, 20:21:20

Hi maddhin,

sieht ja gut aus. Könntest du das Topic folglich als gelöst markieren?


Danke und Grüße
t0m