[blfs-support] LVM2: file descriptor leaked ...

Alexey Orishko alexey.orishko at gmail.com
Sun Mar 29 06:36:36 PDT 2015


Hi guys,

I often see warning messages on console about leaked fd:
File descriptor 7 (pipe:[44180]) leaked on pvs invocation. Parent PID 5760: bash

It could happen if you run lvm command from system() call or from mc shell.

After some investigation I found a passage about it in lvm(8):
On invocation, lvm requires that only the  standard  file  descriptors  stdin,
stdout  and  stderr  are  available.  If others are found, they get closed and
messages are issued warning about the leak.  This warning can be suppressed by
setting the environment variable LVM_SUPPRESS_FD_WARNINGS.

It might be useful for others to mention LVM_SUPPRESS_FD_WARNINGS in
LVM2 chapter.

I'm running lvm commands from daemon and I'd like to set
LVM_SUPPRESS_FD_WARNINGS by default.

In order to get this env var set for any process started by init,
should it be set in /lib/services/init-functions or is there more
appropriate place for it?

regards,
alexey


More information about the blfs-support mailing list