From 7926993940c0d4f8b1bab9557cf972364d782402 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 28 May 2007 21:10:57 +0000 Subject: * added support for 'local:'-URLs, which trigger the automatic start of a busybox-httpd for each repository, through which every request will be routed (thus giving access to files outside of the chroot) * renamed executeInSubprocess() to callInSubprocess() and added a real implementation of executeInSubprocess(), too * updated all settings.local.example files to reflect the new way of accessing local files git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1102 95ad53e4-c205-0410-b2fa-d234c58c8868 --- lib/OpenSLX/Basics.pm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'lib/OpenSLX/Basics.pm') diff --git a/lib/OpenSLX/Basics.pm b/lib/OpenSLX/Basics.pm index 937c99c7..f673d279 100644 --- a/lib/OpenSLX/Basics.pm +++ b/lib/OpenSLX/Basics.pm @@ -23,7 +23,8 @@ $VERSION = 1.01; @EXPORT = qw( &openslxInit %openslxConfig %cmdlineConfig &_tr &trInit - &warn &die &executeInSubprocess &slxsystem + &warn &die + &callInSubprocess &executeInSubprocess &slxsystem &vlog &instantiateClass &addCleanupFunction &removeCleanupFunction @@ -298,7 +299,7 @@ sub _tr } # ------------------------------------------------------------------------------ -sub executeInSubprocess +sub callInSubprocess { my $childFunc = shift; @@ -323,6 +324,23 @@ sub executeInSubprocess } } +# ------------------------------------------------------------------------------ +sub executeInSubprocess +{ + my @cmdlineArgs = @_; + + my $pid = fork(); + if (!$pid) { + # child... + # ...exec the given cmdline: + exec(@cmdlineArgs); + die _tr("error in exec('%s')! (%s)", join(' ', @cmdlineArgs), $!); + } + + # parent... + return $pid; +} + # ------------------------------------------------------------------------------ sub addCleanupFunction { -- cgit v1.2.3-55-g7522