FHEM Forum

FHEM - Entwicklung => FHEM Development => Thema gestartet von: jw2013 am 08 Dezember 2025, 18:52:53

Titel: use lib '.'; in fhem.pl
Beitrag von: jw2013 am 08 Dezember 2025, 18:52:53
Hi,

es wäre schön, wenn die o.g. Zeile aus fhem.pl entfernt werden könnte.

Für Installationen, bei denen "attr global modpath ." gesetzt ist, wird '.' ja korrekterweise als Pfad in @INC mit aufgenommen.

Ansonsten ist es problematisch und führt abhängig vom Init-System (OpenWRT in diesem Fall) und den Verzeichnis-Rechten sogar zu Fehlern. Wenn Perl z.B. nicht als root ausgeführt wird, bricht der Interpreter die Suche nach Modulen nach dem ersten "Permission denied" ab, und sucht nicht in /usr/lib/perl5/5.40/ weiter, wo das Modul zu finden wäre.

2025.12.08 17:04:09 5: Cmd: >define FHEMWEB FHEMWEB 8083 global<
2025.12.08 17:04:09 5: Loading /usr/lib/fhem/FHEM/01_FHEMWEB.pm
2025.12.08 17:04:09 1: reload: Error:Modul 01_FHEMWEB deactivated:
 Can't locate MIME/Base64.pm:   ./MIME/Base64.pm: Permission denied at /usr/lib/fhem/FHEM/HttpUtils.pm line %, <$fh> line 1.
BEGIN failed--compilation aborted at /usr/lib/fhem/FHEM/HttpUtils.pm line %, <$fh> line 1.
Compilation failed in require at /usr/lib/fhem/FHEM/01_FHEMWEB.pm line %, <$fh> line 1.
BEGIN failed--compilation aborted at /usr/lib/fhem/FHEM/01_FHEMWEB.pm line %, <$fh> line 1.

2025.12.08 17:04:09 0: Can't locate MIME/Base64.pm:   ./MIME/Base64.pm: Permission denied at /usr/lib/fhem/FHEM/HttpUtils.pm line %, <$fh> line 1.
BEGIN failed--compilation aborted at /usr/lib/fhem/FHEM/HttpUtils.pm line %, <$fh> line 1.
Compilation failed in require at /usr/lib/fhem/FHEM/01_FHEMWEB.pm line %, <$fh> line 1.
BEGIN failed--compilation aborted at /usr/lib/fhem/FHEM/01_FHEMWEB.pm line %, <$fh> line 1.

2025.12.08 17:04:09 5: /etc/config/fhem/mod.cfg.d/01_fhemweb.cfg line 1 returned >Cannot load module FHEMWEB<
2025.12.08 17:04:09 5: Cmd: >attr FHEMWEB group System<
2025.12.08 17:04:09 5: /etc/config/fhem/mod.cfg line 1 returned >Cannot load module FHEMWEB<

Ohne die eine Zeile in fhem.pl funktioniert alles auch z.B. als Benutzer "fhem".
Titel: Aw: use lib '.'; in fhem.pl
Beitrag von: rudolfkoenig am 08 Dezember 2025, 20:56:09
Zitates wäre schön, wenn die o.g. Zeile aus fhem.pl entfernt werden könnte.
Habs gemacht und versucht fhem mit configDB zu starten:
> perl fhem.pl configDB
2025.12.08 20:54:15 1: Can't locate configDB.pm in @INC (you may need to install the configDB module) (@INC entries checked: /usr/lib/perl5/5.42/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/5.42/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/5.42/core_perl /usr/share/perl5/core_perl) at (eval 9) line 1.
BEGIN failed--compilation aborted at (eval 9) line 1.

Undefined subroutine &main::cfgDB_Init called at fhem.pl line 590.
Exit 2