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