From 1b3a879cf3fc9dee8d23fe452060953c3ff8adf6 Mon Sep 17 00:00:00 2001 From: fukachan Date: Mon, 29 Jan 2001 04:32:34 +0000 Subject: change hierarchy of routines. The current flow is as follows: loader -> process_switch -> FML::Process::Flow -> each process 1. loader resolves version dependence 2. process_switch loads requred package 3. main::ProcessStart() (exporeted to main:: at FML::Process::Flow) controlls flow. 4. details of each flow is described in FML::Process::Something et. al. --- fml/libexec/loader | 52 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 15 deletions(-) (limited to 'fml/libexec/loader') diff --git a/fml/libexec/loader b/fml/libexec/loader index 3998f2b7..d26d129c 100755 --- a/fml/libexec/loader +++ b/fml/libexec/loader @@ -4,7 +4,7 @@ # Copyright (C) 2000-2001 Ken'ichi Fukamachi # All rights reserved. # -# $Id: loader,v 1.1 2001/01/29 03:18:14 fukachan Exp $ +# $Id: loader,v 1.2 2001/01/29 03:23:41 fukachan Exp $ # $FML$ # @@ -34,10 +34,14 @@ BEGIN { # Descriptions: top lebel bootstrap program -# which load the required library and switch myself to it. -# loading order: -# libexec/loader -> libexec/process_switch -> FML::Process::Something +# which load a dispather program (process_switch) +# for process switch. The flow of execution follows: +# libexec/loader -> +# libexec/process_switch -> +# FML::Process::Something # Arguments: none +# XXX this program sees $0 +# (program name, == argv[0] of C language) # Side Effects: switch to the real process # Return Value: none sub Bootstrap @@ -96,18 +100,25 @@ sub Bootstrap # 5. o.k. here we go! if (-f "$libexec_dir/process_switch") { + my ($args, $pkg); + + $args = { + fml_version => $main_cf->{ fml_version }, + + myname => $myname, + ml_home_prefix => $main_cf->{ ml_home_prefix }, + ml_home_dir => $ml_home_dir, + + cf_list => \@cf, + options => \%options, + }; + + # See libexec/process_switch on ProcessSwitch() require "$libexec_dir/process_switch"; - ProcessSwitch( - { - fml_version => $main_cf->{ fml_version }, + $pkg = ProcessSwitch($args); - myname => $myname, - ml_home_prefix => $main_cf->{ ml_home_prefix }, - ml_home_dir => $ml_home_dir, - - cf_list => \@cf, - options => \%options, - }); + # See FML::Process::Kernel module on ProcessStart() + ProcessStart($pkg, $args); } else { croak("$libexec_dir/fml is not found."); @@ -121,10 +132,21 @@ loader -- the wrapper which executes a real fml5 program. =head1 SYNOPSIS -loader C<[-c main.cf]> C<[--debug]> C<[--ctladdr]> ml_home_dir +loader C<[-c main.cf]> C<[--debug]> C<[--ctladdr]> [ml_home_dir] =head1 DESCRIPTION +The loader resolves fml version dependence. +It checks /etc/fml/main.cf and prepare @INC for some fml version. +The real process switch routine is dependent on fml version. + +C switches itself to a program specified by $0. +C analyzes several conditions +specified by main.cf, @INC and $0 et. al. +The swithing is done in libexec/fml/$VERSION/process_switch. +See C for more details on process +switching. + C<-c main.cf> main.cf alternative -- cgit v1.2.1