From a306e1867638f1d612e6b2d2eceeb289d01f3e1d Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 26 Apr 2014 06:53:09 +0000 Subject: [PATCH] fhem.pl: RType fixes git-svn-id: https://svn.fhem.de/fhem/trunk@5657 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 8e3883193..1ecf5230e 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -391,14 +391,6 @@ if($^O =~ m/Win/) { } $winService ||= {}; -################################################### -# initialize the readings semantics meta information -# this must come before any module is loaded -eval { # make errors non-lethal - require FHEM::RTypes; - RTypes_Initialize(); -}; - ################################################### # Server initialization doGlobalDef($ARGV[0]); @@ -417,12 +409,10 @@ setGlobalAttrBeforeFork($attr{global}{configfile}); Log 1, $_ for eval{@{$winService->{ServiceLog}};}; +# Go to background if the logfile is a real file (not stdout) if($^O =~ m/Win/ && !$attr{global}{nofork}) { $attr{global}{nofork}=1; } - - -# Go to background if the logfile is a real file (not stdout) if($attr{global}{logfile} ne "-" && !$attr{global}{nofork}) { defined(my $pid = fork) || die "Can't fork: $!"; exit(0) if $pid; @@ -434,6 +424,11 @@ while(time() < 2*3600) { sleep(5); } +################################################### +# initialize the readings semantics meta information +require RTypes; +RTypes_Initialize(); + my $cfgErrMsg = "Error messages while initializing FHEM:"; my $cfgRet=""; if(configDBUsed()) { @@ -3216,6 +3211,7 @@ setGlobalAttrBeforeFork($) $v =~ s/#.*//; $v =~ s/ .*$//; $attr{global}{$n} = $v; + GlobalAttr("set", "global", $n, $v); } close(FH); }