FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: SamNitro am 31 Mai 2018, 00:50:28

Titel: Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: SamNitro am 31 Mai 2018, 00:50:28
Ja wie im Titel schon zu lesen startet mein Fhem leider nicht mehr automatisch. Leider hat keine Anleitung bei mir gepasst. Keine Ahnung seit wann das ist. Ob es evtl an der Umstellung auf DBlog oder ConfigDB ist kann ich jetzt nicht mehr sagen.

Ein problem habe ich mit den rechten auf ein fhem.log

pi@FHEM:~ $ ls -lha /opt/fhem
insgesamt 696K
drwxr-xr-x 12 fhem dialout 4,0K Mai 30 23:52 .
drwxr-xr-x  4 root root    4,0K Aug 18  2017 ..
drwxr-xr-x  2 fhem dialout 4,0K Mai 16 16:22 backup
-rw-rw-rw-  1 fhem dialout 244K Mai 24 20:23 CHANGED
-rw-r--r--  1 fhem dialout  910 Mai  2 18:28 configDB.conf
-rw-rw-rw-  1 fhem dialout  41K Mai  9 10:36 configDB.pm
drwxrwxrwx 40 fhem dialout  20K Aug 19  2016 contrib
drwxrwxrwx  3 fhem dialout 4,0K Jan 27  2016 demolog
drwxrwxrwx  4 fhem dialout  12K Jul  2  2017 docs
drwxrwxrwx  6 fhem dialout  68K Mai 31 00:44 FHEM
-rw-rw-rw-  1 fhem dialout  48K Mai  2 18:53 fhem.cfg
-rw-rw-rw-  1 fhem dialout  16K Mai  9 10:36 fhem.cfg.demo
-rwxrwxrwx  1 fhem dialout 143K Mai 16 16:20 fhem.pl
-rwxr-xr-x  1 fhem dialout 2,7K Mai 15 19:00 ircmd.sh
drwxrwxrwx  2 fhem dialout 4,0K Mai 31 00:00 log
-rw-r--r--  1 fhem dialout  37K Mai 16 16:20 MAINTAINER.txt
-rw-rw-rw-  1 fhem dialout  935 Nov 15  2015 README_DEMO.txt
drwxrwxrwx  7 fhem dialout 4,0K Mär 27 23:54 restoreDir
drwxrwxrwx  2 fhem dialout 4,0K Aug  7  2017 unsed
drwxrwxrwx  2 fhem dialout 4,0K Aug 25  2017 unused
-rwxr-xr-x  1 fhem dialout 1,9K Apr 30 14:39 updatecheck.sh
-rw-r--r--  1 fhem dialout  180 Aug 18  2017 .wget-hsts
drwxrwxrwx 11 fhem dialout 4,0K Apr 25 12:11 www
pi@FHEM:~ $ ls -lha /opt/fhem/log
insgesamt 380K
drwxrwxrwx  2 fhem dialout 4,0K Mai 31 00:00 .
drwxr-xr-x 12 fhem dialout 4,0K Mai 30 23:52 ..
-rw-rw-rw-  1 fhem dialout 114K Mai  2 18:57 eventTypes.txt
-rw-r--r--  1 fhem dialout 3,7K Mai 26 00:00 fhem-2018-05-25.log
-rw-r--r--  1 fhem dialout 2,4K Mai 26 22:03 fhem-2018-05-26.log
-rw-r--r--  1 fhem dialout 4,8K Mai 28 00:00 fhem-2018-05-27.log
-rw-r--r--  1 fhem dialout 3,3K Mai 29 00:00 fhem-2018-05-28.log
-rw-r--r--  1 fhem dialout  19K Mai 29 23:58 fhem-2018-05-29.log
-rw-r--r--  1 fhem dialout  38K Mai 31 00:00 fhem-2018-05-30.log
-rw-r--r--  1 pi   pi      9,6K Mai 31 00:44 fhem-2018-05-31.log
-rw-rw-rw-  1 fhem dialout 155K Mai  2 18:57 fhem.save
pi@FHEM:~ $

Die werden mit pi erstellt aber warum?

pi@FHEM:~ $ systemctl status fhem.service
● fhem.service - LSB: FHEM server
   Loaded: loaded (/etc/init.d/fhem; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2018-05-31 00:26:00 CEST; 10min ago
     Docs: man:systemd-sysv-generator(8)

Mai 31 00:26:00 FHEM fhem[386]: found: `fhem`.`fhemconfig`
Mai 31 00:26:00 FHEM fhem[386]: found: `fhem`.`fhemstate`
Mai 31 00:26:00 FHEM fhem[386]: found: `fhem`.`fhemversions`
Mai 31 00:26:00 FHEM fhem[386]: found: `fhem`.`history`
Mai 31 00:26:00 FHEM fhem[386]: table not found
Mai 31 00:26:00 FHEM fhem[386]: don't worry about above messages!
Mai 31 00:26:00 FHEM systemd[1]: fhem.service: Control process exited, code=exited status=13
Mai 31 00:26:00 FHEM systemd[1]: Failed to start LSB: FHEM server.
Mai 31 00:26:00 FHEM systemd[1]: fhem.service: Unit entered failed state.
Mai 31 00:26:00 FHEM systemd[1]: fhem.service: Failed with result 'exit-code'.
pi@FHEM:~ $


von Hand geht es:
pi@FHEM:~ $ /etc/init.d/fhem start
Starting fhem...
looking for table: fhembinfilesave
testing: #1
found: `fhem`.`current`
found: `fhem`.`fhemb64filesave`
found: `fhem`.`fhemconfig`
found: `fhem`.`fhemstate`
found: `fhem`.`fhemversions`
found: `fhem`.`history`
table not found
don't worry about above messages!
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: SamNitro am 31 Mai 2018, 00:55:46
sehe gerade das Probleme DBI connect('database=fhem;host=localhost;port=3306','fhemuser',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "Datei oder Verzeichnis nicht gefunden") at configDB.pm line 750.

Wie bekomme ich das bereinigt?
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: Maui am 31 Mai 2018, 09:52:58
Dein mysql wird noch nicht so weit sein denke ich. Versuch mal in Requiered Start: $mysql hinzuzufügen.
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: SamNitro am 31 Mai 2018, 10:14:48
Schande über mein Haupt :-[
habe mein fhemuser Passwort mal geändert da waren Sonderzeichen mit drin.

Jetzt geht es, trotzdem danke. (warum bin ich da nicht schon eher mal drauf gekommen)
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: SamNitro am 31 Mai 2018, 10:17:56
zu früh gefreut.

Fhem startet jetzt zwar aber:
2018.05.31 10:16:10 3: DbLog DBLogging - Creating Push-Handle to database mysql:database=fhem;host=localhost;port=3306 with user fhemuser
2018.05.31 10:16:10 2: DbLog DBLogging - Error: DBI connect('database=fhem;host=localhost;port=3306','fhemuser',...) failed: Access denied for user 'fhemuser'@'localhost' (using password: YES) at ./FHEM/93_DbLog.pm line 2355.


jetzt kommt das hier im loop
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: Wernieman am 31 Mai 2018, 10:24:33
ZitatAccess denied for user 'fhemuser'@'localhost'

Geht denn ein Login mit diesem User/Passwort auf die DB?
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: SamNitro am 31 Mai 2018, 10:26:54
Ja beim login kommt das hier:

pi@FHEM:~ $ mysql -u fhemuser -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 51
Server version: 10.1.23-MariaDB-9+deb9u1 Raspbian 9.0

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use fhem;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [fhem]> show tables;
+-----------------+
| Tables_in_fhem  |
+-----------------+
| current         |
| fhemb64filesave |
| fhemconfig      |
| fhemstate       |
| fhemversions    |
| history         |
+-----------------+
6 rows in set (0.00 sec)

MariaDB [fhem]>
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: Wernieman am 31 Mai 2018, 10:30:41
Probgiere bitte mal auf "localhost"
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: SamNitro am 31 Mai 2018, 10:31:39
wie meinst du das?
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: Wernieman am 31 Mai 2018, 10:37:48
Du gehst mit dem Kommandowerkzeug eventuell nicht übers Netzwerk und damit sit der Test nicht 100% sauber ...
mysql -h localhost -u fhemuser -p
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: SamNitro am 31 Mai 2018, 10:38:50
Doch auch das funktioniert.
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: Wernieman am 31 Mai 2018, 10:57:11
Du bist Dir sicher, mit der Richtigen Konfiguration User/Passwort/Server in FHEM?
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: SamNitro am 31 Mai 2018, 11:03:51
Anfangs hat es ja funktioniert nur der Neustart nicht... aber alles andere

dann habe ich das Passwort geändert ohne Sonderzeichen.
jetzt funktioniert der Neustart aber der rest nicht mehr.

Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: CoolTux am 31 Mai 2018, 11:05:53
Wie hast Du das Passwort geändert und vor allem von was? Von dem FHEM Datenbankuser?
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: SamNitro am 31 Mai 2018, 11:11:27
ich habe das mit dem program Sequel Pro gemacht und danach die configDB.conf angepasst.

ja genau fhemuser so er bei mir

Edit:einloggen kann ich mich ja auch hiermit:
mysql -h localhost -u fhemuser -p
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: SamNitro am 31 Mai 2018, 11:20:24
nutzen ConfigDB und DBlog das selbe Passwort in der Datei configDB.conf??
Titel: Antw:Fhem startet nicht automatisch nach reboot des RPI
Beitrag von: SamNitro am 31 Mai 2018, 16:55:54
Also configDB läuft noch aber DBLog nicht... jemand eine Ahnung?




Mobil unterwegs!