X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FInitHandler.pm;h=5038cf352ef7c31e4734e54a389723eac7defe7d;hp=73697300e2aa5334a74ae58a62460ab586ade85e;hb=5d154e4e153a66c2349ee0c6ca942fa017bfb139;hpb=e9af247503b619f0c61a3ba14481bc76752bdd8b diff --git a/FS/FS/InitHandler.pm b/FS/FS/InitHandler.pm index 73697300e..5038cf352 100644 --- a/FS/FS/InitHandler.pm +++ b/FS/FS/InitHandler.pm @@ -1,5 +1,9 @@ package FS::InitHandler; +# this leaks memory under graceful restarts and i wouldn't use it on any +# modern server. useful for very slow machines with memory to spare, just +# always do a full restart + use strict; use vars qw($DEBUG); use FS::UID qw(adminsuidsetup); @@ -9,15 +13,13 @@ $DEBUG = 1; sub handler { -=pod - use Date::Format; use Date::Parse; use Tie::IxHash; use HTML::Entities; use IO::Handle; use IO::File; - use String::Approx: + use String::Approx; use HTML::Widgets::SelectLayers 0.02; #use FS::UID; #use FS::Record; @@ -45,12 +47,11 @@ sub handler { use FS::part_svc; use FS::pkg_svc; use FS::port; - use FS::queue qw(joblisting); + use FS::queue; use FS::raddb; use FS::session; use FS::svc_acct; - use FS::svc_acct_pop qw(popselector); - use FS::svc_acct_sm; + use FS::svc_acct_pop; use FS::svc_domain; use FS::svc_forward; use FS::svc_www; @@ -60,15 +61,17 @@ sub handler { use FS::export_svc; use FS::msgcat; -=cut - warn "[FS::InitHandler] handler called\n" if $DEBUG; + #this is sure to be broken on freebsd + $> = $FS::UID::freeside_uid; + open(MAPSECRETS,"<$FS::UID::conf_dir/mapsecrets") or die "can't read $FS::UID::conf_dir/mapsecrets: $!"; my %seen; while () { + next if /^\s*(#|$)/; /^([\w\-\.]+)\s(.*)$/ or do { warn "strange line in mapsecrets: $_"; next; }; my($user, $datasrc) = ($1, $2); @@ -79,6 +82,10 @@ sub handler { close MAPSECRETS; + #lalala probably broken on freebsd + ($<, $>) = ($>, $<); + $< = 0; + } 1;