Hallo zusammen,
ich wollte von FileLog auf DBLog umstellen und nach der Installation von SQLite lässt sich FHEM nicht mehr starten.
Fehler:
/opt/fhem > sudo /etc/init.d/fhem start
-bash: /etc/init.d/fhem: Datei oder Verzeichnis nicht gefunden
Die Datei ist tatsächlich nicht mehr vorhanden... Wie kann ich jetzt vorgehen?
Neuinstallieren? Wird dabei irgendwas überschrieben?
Gruß Arek
Einfach einen neue Startscript anlegen.
Hier ein Beispiel: http://www.patrick-gotthard.de/eigene-startscripte-fuer-linux-schreiben
EDIT: nachdem ich sowieso gerade bei mir was nachschauen musste, hier mein Startscriot:
#!/bin/sh
# description: Start or stop the fhem server
# Added by Alex Peuchert
### BEGIN INIT INFO
# Provides: fhem.pl
# Required-Start: $local_fs $remote_fs mysql
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: FHEM server
### END INIT INFO
set -e
cd /opt/fhem
port=7070
if test "$2" != "noaptmark"; then
apt-mark hold fhem > /dev/null
fi
case "$1" in
'start')
echo "Starting fhem..."
# if you need to start hmland for use with
# Homematic, please start the hmland daemon
# like this (please use correct path and port,
# depending on your installation!)
#
# /opt/hmcfgusb/hmland -d -p 1234 -r 0
#
# perl fhem.pl configDB
perl fhem.pl fhem.cfg
# if you want to use configDB for configuration,
# use this command to start fhem:
#
# perl fhem.pl configDB
#
# and remove/comment the above line including fhem.cfg
RETVAL=$?
;;
'stop')
echo "Stopping fhem..."
# if you want to stop hmland during fhem stop:
# pkill hmland
pkill -U fhem perl
RETVAL=$?
;;
'status')
cnt=`ps -ef | grep "fhem.pl" | grep -v grep | wc -l`
if [ "$cnt" -eq "0" ] ; then
echo "fhem is not running"
else
echo "fhem is running"
fi
;;
*)
echo "Usage: $0 { start | stop | status }"
RETVAL=1
;;
esac
exit $RETVAL
/opt/fhem > /etc/init.d/fhem start
Starting fhem...
Can't open perl script "fhem.pl": Datei oder Verzeichnis nicht gefunden
Was ist denn da passiert???
Hat das mit SQLite zu tun?
Ich habe nur folgenden Befehl ausgeführt:
sudo apt-get install sqlite3 libdbi-perl libdbd-sqlite3-perl
Nachdem ich mir die fhem.pl aus einem Backup wieder hineinkopiert habe bekomme ich folgenden Fehler:
Starting fhem...
Can't locate Time/HiRes.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at fhem.pl line 36.
BEGIN failed--compilation aborted at fhem.pl line 36.
Dir hat es wohl noch mehr "zerlegt".
Am besten nochmal ein Backup der cdg Datei und dann neu installieren.
Auch alle Perl Module testen und evtl. Nachinstallieren
Das Perl Modul Time::HiRes fehlt. Entweder mit cpan, cpanm oder apt-get installieren.
Also ich habe jetzt folgendes gemacht:
apt-get update
apt-get upgrade
fhem neu installiert
Jetzt läuft wieder alles. Vielen Dank für die Hilfe.