JoschaMiddendorf / fhem-docker

Docker Container for FHEM House-Automation-System - Full install with all dependencies
MIT License
6 stars 0 forks source link

New Concept #6

Closed JoschaMiddendorf closed 6 years ago

JoschaMiddendorf commented 6 years ago

Changed the concept of starting FHEM and copying config data to use only one script. Currently FHEM ist running inf foreground by "attr global nofork 1", stopping the container doesn't stop FHEM but just kills the forground process "perl fhem.pl fhem.cfg | tee /opt/fhem/log/fhem.log". Im still working on a workaround do trap the docker stop signals to stop fhem gracefully and maybe put fhem in the background again.

notes background: attr global nofork 0 perl fhem.pl fhem.cfg (background) FHEMrunning = true function StopFHEM { /usr/bin/fhem.pl 7073 shutdown $FHEMrunning = false } trap "StopFHEM" SIGINT SIGTERM while [ $FHEMrunning = true ] do tail -f /opt/fhem/log/fhem.log done

notes foreground: attr global nofork 1 function StopFHEM { /usr/bin/fhem.pl 7073 shutdown } trap "StopFHEM" SIGINT SIGTERM perl fhem.pl fhem.cfg | tee /opt/fhem/log/fhem.log