FHEM does not start automatically after "shutdown" (and reboot of the system)

Begonnen von Martijn, 22 Februar 2015, 23:01:22

Vorheriges Thema - Nächstes Thema

Martijn

Hi, I have installed FHEM on my MK802 with Linaro. It installed perfectly and worked perfectly, but when I send the command "shutdown" (without restart) it will not start FEM again after a reboot of the system. This happend twice.
I'm a bit new on linux. When I do the following I get:
linaro@linaro-alip:/opt/fhem$ sudo /etc/init.d/fhem start
Segmentation fault

Manually starting FHEM works:
cd /opt/fhem
sudo perl fhem.pl fhem.cfg

Who can help?

Wernieman

- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

Martijn

#!/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
# 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=7072

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 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