[Wellington-pm] question about 'system', and other methods for calling os functions

Richard Hector richard at walnut.gen.nz
Tue Apr 19 03:01:21 PDT 2011


Hi all,

I'm trying to call 'lvcreate' to create a logical volume on a linux
system.

Apparently, all lvm commands are sensitive to how many filehandles they
have, and it appears that perl creates 3 extra ones (DATA, ARGV and
ARGVOUT), which get passed through and cause warnings:

File descriptor 5 (socket:[16653008]) leaked on lvcreate invocation. Parent PID 18226: /usr/bin/perl
File descriptor 6 (pipe:[16653009]) leaked on lvcreate invocation. Parent PID 18226: /usr/bin/perl
File descriptor 7 (pipe:[16653009]) leaked on lvcreate invocation. Parent PID 18226: /usr/bin/perl

Can anybody suggest how to call an external function in such a way that
those extra handles are not visible?

I've tried forking, then closing them in the child before calling system
(I know that means 2 forks; if it had worked I'd have looked at exec
instead), but get the same result.

Many thanks,

Richard




More information about the Wellington-pm mailing list