FHEM 5.7 Installation mit Active perl 5.22 unter DSM 6.0

Begonnen von Diggewuff, 30 Mai 2016, 10:02:04

Vorheriges Thema - Nächstes Thema

Diggewuff

Hallo liebe Leute,

ich bin momentan dabei nach einem Weg zu suchen, FHEM 5.7 auf meiner DS713+ (Intel) unter DSM 6.0 zu Installieren.
Statt der Synology Perl Version möchte ich gemäß Empfehlung von justme1968 Active perl 5.22 verwenden, allerdings habe ich Probleme dabei das Start Script dahin gehend an zu passen das FHEM Die Active Perl Version verwendet und nicht die Perl Version von Synology.

Was habe ich bis jetzt unternommen:

Installation von Active Perl:
sudo ./install.sh
Password:
Checking package...done

Welcome to ActivePerl

    ActivePerl is ActiveState's quality-assured binary build of
    Perl.  In order to install ActivePerl you need to agree to
    the ActivePerl is covered by the ActiveState Community License..

Did you read the LICENSE.txt file? [no] yes
Do you agree to the ActivePerl is covered by the ActiveState Community License.? [no] yes

    This installer can install ActivePerl in any location of your
    choice. You do not need root privileges.  However, please make sure
    that you have write access to this location.

Enter top level directory for install? [/opt/ActivePerl-5.22]

    The ActivePerl documentation is available in HTML format.  If installed
    it will be available from file:///opt/ActivePerl-5.22/html/index.html.
    If not installed you will still be able to read all the basic perl and
    module documentation using the man or perldoc utilities.

Install HTML documentation [yes]
Ok.

    The typical ActivePerl software installation requires 200 megabytes.
    Please make sure enough free space is available before continuing.

Proceed? [yes]
Ok.

Installing ActivePerl...
Copying files to /opt/ActivePerl-5.22...done
Relocating...done (233 files relocated)
Generating HTML documentation...
done
Syncing perl PPM database with .packlists...

done

ActivePerl has been successfully installed at /opt/ActivePerl-5.22.

Please modify your startup environment by adding:

   /opt/ActivePerl-5.22/site/bin:/opt/ActivePerl-5.22/bin to PATH
   /opt/ActivePerl-5.22/site/man:/opt/ActivePerl-5.22/man to MANPATH

For general questions or comments about ActivePerl, please
contact us at <support@activestate.com>.

Thank you for using ActivePerl!


Installation von FHEM:

fhem_noarch-all_5.7-mfr-20160330.spk

Dafür war leider vorher die Installation der Perl Version von Synology notwendig.

FRAGE 1:
Gibt es eine Möglichkeit die Abhängigkeit von fhem_noarch-all_5.7-mfr-20160330.spk zum Synology Perl zu umgehen um Synology Perl wieder zu deinstallieren? Beim versuch Synology Perl zu Deinstallieren bekomme ich vom Packet Zentrum die Mitteilung das dass Packet FHEM von Synology Perl abhängig ist und das ich zuerst FHEM deinstallieren soll.



Anpassung des Pfades zu Perl in FHEM Start Script:

im Verzeichnis /usr/local/FHEM/app/ existierte bei mir kein Ordner scripts, also habe ich mal gesucht und unter dem Pfad /volume1/@appstore/fhem/opt/contrib/Synology/scripts/ eine Datei fhem.sh gefunden die ich auf den Installationspfad von Active Perl angepasst habe.

#!/bin/sh
#
#
HOME='/var/packages/FHEM/target'
PERL=/opt/ActivePerl-5.22
KMOD=/var/packages/usb-driver-kernel
PATH=$HOME:$PERL:$PATH
export PATH

fhem_BIN=${HOME}/fhem.pl
test -x ${fhem_BIN} || { echo "${fhem_BIN} not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }

# Check for existence of needed config file and read it
fhem_CONFIG=${HOME}/fhem.cfg
test -r ${fhem_CONFIG} || { echo "${fhem_CONFIG} not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }

fhem_LOG=/var/log/fhem-`date +"%Y-%m"`.log

perl_BIN=`which perl`

#
case "$1" in
start)
echo "Starting fhem "
if [ -d "${KMOD}" ]; then
if [ ! -f "${KMOD}/enabled" ]; then
${KMOD}/scripts/start-stop-status start
touch ${KMOD}/enabled && chmod 775 ${KMOD}/enabled
fi
fi

${perl_BIN} $fhem_BIN $fhem_CONFIG
;;
stop)
echo "Shutting down fhem "
${perl_BIN} $fhem_BIN 7072 shutdown
;;
restart)
$0 stop
$0 start
;;
status)
echo -n "Checking for service fhem "
ps|grep fhem.pl
;;
log)
test -r $fhem_LOG || { echo "$fhem_LOG not existing"; exit 0; }
echo $fhem_LOG
;;
*)
echo "Usage: $0 {start|stop|status|restart|log}"
exit 1
;;
esac
exit 0


fheminfo liefert allerdings:

ZitatFhem info:
  Release  : 5.7
  OS       : linux
  Arch     : x86_64-linux
  Perl     : v5.18.4
  uniqueID : fbdaebdd667e54012fe3cea06b40d98d
  upTime   : 00:09:34

Defined modules:
  FHEMWEB    : 3
  FileLog    : 1
  autocreate : 1
  eventTypes : 1
  notify     : 1
  telnet     : 1

Transmitting this information during an update: no
You can change this via the global attribute sendStatistics

was darauf schließen lässt das immer noch die Synology Perl version verwendet wird, da hier die Version überein stimmt.

in  /volume1/@appstore/fhem/bin/ liegt noch eine weitere fhem.sh mit folgendem Inhalt:

#!/bin/sh
#
#
HOME=/usr/local/fhem/opt
PATH=$HOME:$PATH
export PATH
cd ${HOME}                                                     

fhem_BIN=${HOME}/fhem.pl
test -x ${fhem_BIN} || { echo "${fhem_BIN} not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }

# Check for existence of needed config file and read it
fhem_CONFIG=${HOME}/fhem.cfg
test -r ${fhem_CONFIG} || { echo "${fhem_CONFIG} not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }

fhem_LOG=${HOME}/log/fhem-`date +"%Y-%m"`.log

#
case "$1" in
start)
echo "Starting fhem "
$fhem_BIN $fhem_CONFIG
;;
stop)
echo "Shutting down fhem "
$fhem_BIN 7072 shutdown
;;
restart)
$0 stop
$0 start
;;
status)
echo -n "Checking for service fhem "
ps|grep fhem.pl
;;
log)
test -r $fhem_LOG || { echo "$fhem_LOG not existing"; exit 0; }
echo $fhem_LOG
;;
*)
echo "Usage: $0 {start|stop|status|restart|log}"
exit 1
;;
esac
exit 0


dort wüsste ich allerdings nicht welche Zeile ich anpassen könnte um auf /opt/ActivePerl-5.22 zu verweisen.

Weitere fhem.sh gibt es nicht!

FRAGE 2:
Habe ich eventuell bei der Anpassung des Start Scripts etwas falsch gemacht was dazu führt das FHEM, Active Perl noch nicht nutzt? oder sind eventuell noch weitere Anpassungen Notwendig?

FRAGE 3:
Ich habe noch einen Config file Editor und Webmin installiert die auch Perl nutzen kann ich irgendwie dafür sorgen das diese auch Active Perl nutzen?


Ich Freue mich auf eure Unterstützung.

Gruß Joscha

a-p-s

Hallo,

also ich habe bei mir die Active-Perl 5.22 für FHEM im Einsatz, indem ich in der Datei /var/packages/FHEM/target/app/scripts/fhem.sh die entsprechende Zeile geändert habe.

Sonst waren dafür keine Änderungen erforderlich. Man muss nur aufpassen, dass wenn man zusätzliche Module installiert, die entsprechenden Tools im ActivePerl-Verzeichnis nutzt (also z.B. cpan oder pip).

Ich habe die Perl-Version nicht global geändert, weil das sonst anderswo zu Problemen geführt hätte (zumindest damals, als ich das versuchte).

Grüße,
a-p-s

Diggewuff

#2
In dem Ordner  /var/packages/fhem/ existiert bei mir ein link /target der in das Verzeichnis /volume1/@appstore/fhem/ verweist. dort gibt es dann einen Ordner /app allerdings ist dort kein Ordner Skripts zu finden und auch keine Datei /fhem.sh.

Daher habe ich die Anpassungen, in der von mir im Ordner /volume1/@appstore/fhem/opt/contrib/Synology/scripts/ gefundenen Datei /fhem.sh, vorgenommen,
doch das führt scheinbar nicht zum gewünschten Ergebnis.

sven.scherf

Hallo,

hast du es denn mal mit der Perl Version von der NAS ausprobiert ?
Bei mir funktioniert FHEM mit der Perl Version von meiner Synlogy DS 213.

Perl Version: 5.18.4-0023
DSM: 5.2
FHEM: 5.3 und allen updates

Viele Grüße

Sven
Raspi 3 mit CUL Stick 433/868MHZ, Homematic