diff options
author | Oliver Tappe | 2007-05-28 23:10:57 +0200 |
---|---|---|
committer | Oliver Tappe | 2007-05-28 23:10:57 +0200 |
commit | 7926993940c0d4f8b1bab9557cf972364d782402 (patch) | |
tree | 476820b404df19f3c9569bf0ee4615c87d288479 /lib/OpenSLX/Basics.pm | |
parent | * fixed bug introduced with last commit, package-installation was hosed (diff) | |
download | core-7926993940c0d4f8b1bab9557cf972364d782402.tar.gz core-7926993940c0d4f8b1bab9557cf972364d782402.tar.xz core-7926993940c0d4f8b1bab9557cf972364d782402.zip |
* 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
Diffstat (limited to 'lib/OpenSLX/Basics.pm')
-rw-r--r-- | lib/OpenSLX/Basics.pm | 22 |
1 files changed, 20 insertions, 2 deletions
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; @@ -324,6 +325,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 { my $name = shift; |