Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] How to avoid:WARNING: Failed to connect to lvmetad.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3943
Location: Hamburg

PostPosted: Sun Mar 13, 2016 12:16 pm    Post subject: [solved] How to avoid:WARNING: Failed to connect to lvmetad. Reply with quote

Why do I get :
Code:
ms-magpie ~ # /etc/init.d/tor stop
 * Caching service dependencies ...
File descriptor 3 (pipe:[3216316]) leaked on lvm invocation. Parent PID 1923: /bin/sh
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.                                                                             [ ok ]
 * Stopping Tor ...                                                                                                                                     [ ok ]


Last edited by toralf on Sun Mar 13, 2016 2:37 pm; edited 1 time in total
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6780

PostPosted: Sun Mar 13, 2016 2:02 pm    Post subject: Reply with quote

It is a bug (or better: over-engineering) of the new sys-fs/lvm2 init scripts:
Just in order to "magically guess" possible exotic dependencies of the lvm init scripts, they try to contact the lvmd daemon in every dependency calculation.

IMHO this is a misuse of the configuration possibilities openrc gives you: For instance, everybody who has lvm2 just installed because it is needed for things like cryptsetup and who does not really want to use lvm2 is hit by this (for him completely unnecessary) task for every dependency calculation of openrc.

IMHO, the correct solution would be to expect the user of lvm2 to add any exotic dependencies in /etc/conf.d/* if he needs them.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6780

PostPosted: Sun Mar 13, 2016 2:26 pm    Post subject: Reply with quote

There is a bug opened for this.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3943
Location: Hamburg

PostPosted: Sun Mar 13, 2016 2:36 pm    Post subject: Reply with quote

mv wrote:
There is a bug opened for this.
Thx Martin
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sun Mar 13, 2016 2:47 pm    Post subject: Reply with quote

toralf ...

I haven't read the bug report, or looked at the new initscript (>sys-fs/lvm2-2.02.103 is masked here), but it should be sufficient to add rc_need="!lvmetad" to /etc/rc.conf and so avoid the dependency.

HTH & best ... khay
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6780

PostPosted: Sun Mar 13, 2016 4:23 pm    Post subject: Reply with quote

khayyam wrote:
but it should be sufficient to add rc_need="!lvmetad" to /etc/rc.conf and so avoid the dependency.

The problem is not any dependency, but that lvm is called within the depend() function of /etc/init.d/lvm. Adding a dependency wouldn't change that this function (and thus lvm) is executed.
Of course, it might suppress the error message if lvmd is running, but it is strange to start a daemon which is not needed on a machine just to suppress an error in a dependency calculation.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3943
Location: Hamburg

PostPosted: Sun Mar 13, 2016 4:33 pm    Post subject: Reply with quote

indeed - depend() should be a static checker mostly
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sun Mar 13, 2016 9:24 pm    Post subject: Reply with quote

mv wrote:
khayyam wrote:
but it should be sufficient to add rc_need="!lvmetad" to /etc/rc.conf and so avoid the dependency.

The problem is not any dependency, but that lvm is called within the depend() function of /etc/init.d/lvm. Adding a dependency wouldn't change that this function (and thus lvm) is executed.
Of course, it might suppress the error message if lvmd is running, but it is strange to start a daemon which is not needed on a machine just to suppress an error in a dependency calculation.

mv ... I see, and I looked and the initscript, eewwww, stuff like that makes me cringe.

best ... khay
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Wed Mar 16, 2016 12:26 pm    Post subject: Reply with quote

mv wrote:
It is a bug (or better: over-engineering) of the new sys-fs/lvm2 init scripts:
Just in order to "magically guess" possible exotic dependencies of the lvm init scripts, they try to contact the lvmd daemon in every dependency calculation.

IMHO this is a misuse of the configuration possibilities openrc gives you: For instance, everybody who has lvm2 just installed because it is needed for things like cryptsetup and who does not really want to use lvm2 is hit by this (for him completely unnecessary) task for every dependency calculation of openrc.

IMHO, the correct solution would be to expect the user of lvm2 to add any exotic dependencies in /etc/conf.d/* if he needs them.
..
The problem is not any dependency, but that lvm is called within the depend() function of /etc/init.d/lvm. Adding a dependency wouldn't change that this function (and thus lvm) is executed.
Of course, it might suppress the error message if lvmd is running, but it is strange to start a daemon which is not needed on a machine just to suppress an error in a dependency calculation.

Well, if it's not running, it is not started (hence the error message, now suppressed.) Which makes one wonder just how it would have been started if not selected by the user (so why even do this? I guess to bring down lvm if lvmetad goes down, in terms of correctness, though I'm not sure how useful that really is.)

I agree with your overall point: depend() should be considered the same as "global scope" in ebuilds, since it is precisely the same situation ie: dependency resolution (which has to be cached in the ebuild case, whence the restrictions upon ebuilds.)
The only "dynamism" allowed should be specifically in response to configuration, not the external environment.

For the specific, it seems like it would be much better simply to advise users to add rc_need=lvmetad to /etc/conf.d/lvm, in order to enable lvmetad (which is only used in specific situations), instead of adding it to the runlevel, and then on our side calling out to the external in every dependency calculation.

OTOH, I thought this is what "want" dependencies were about. (A "need" that does not pull the other service into the runlevel.)
Back to top
View user's profile Send private message
s4e8
Guru
Guru


Joined: 29 Jul 2006
Posts: 311

PostPosted: Thu Apr 13, 2017 3:50 am    Post subject: Reply with quote

After 1 year, and this warning didn't solved. This problem is openrc open a pipe at fd[3], and inherited by lvm cmdline process, but lvm don't like extra opened fd except 0/1/2. Add following line to /etc/conf.d/lvm would suppress this warning:
export LVM_SUPPRESS_FD_WARNINGS=1
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3943
Location: Hamburg

PostPosted: Thu Apr 13, 2017 4:15 pm    Post subject: Reply with quote

s4e8 wrote:
After 1 year, and this warning didn't solved. This problem is openrc open a pipe at fd[3], and inherited by lvm cmdline process, but lvm don't like extra opened fd except 0/1/2. Add following line to /etc/conf.d/lvm would suppress this warning:
export LVM_SUPPRESS_FD_WARNINGS=1
So worth to file a bug against
Code:
~ $ equery meta -m lvm2
 * sys-fs/lvm2 [gentoo]
robbat2@gentoo.org (Robin H. Johnson)
agk@redhat.com (Alasdair Kergon)
Upstream Maintainer (please CC on bugs)
cardoe@gentoo.org (Doug Goldstein)
Backup to Robin. Please CC on bugs.
?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23180

PostPosted: Fri Apr 14, 2017 1:49 am    Post subject: Reply with quote

That depends on whether the pipe is open because it needs to be open (and LVM should cease complaining about this necessary descriptor) or if the pipe is open because it never caused enough problems to be worth closing (and LVM is right to complain, and we should push to have openrc not leave that pipe open in this process).
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Fri Apr 14, 2017 5:17 pm    Post subject: Reply with quote

Ah just seen this recently on new install; correct solution is to edit /etc/lvm/lvm.conf and set: use_lvmetad=0 (about line 861 here.)
The initscript checks the conf file, so doing that sorts out the openrc side.

Personally I feel that is not really a "solution" (unless applied at distro level, or upstream), but a workaround for a bad default.
I do not like "automagic" dependencies either; a server-admin who needs lvmetad has to set it up, before enabling it. The rest of us don't care, and shouldn't have to.

I still got the "fd 3" thing for a bit, because I hadn't quite got my dependencies right for udev without initramfs, and something (likely udev) was starting up lvm too early.

Anyone know the bit of shell or code where openrc is opening that fd?

I've got it booting smoothly on lvm2 version 2.02.145-r2, if that helps anyone concerned about upgrading.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum