Bug 494827 - Latest ypbind update causes autofs YP maps to fail to load.
Latest ypbind update causes autofs YP maps to fail to load.
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: ypbind (Show other bugs)
10
All Linux
high Severity high
: ---
: ---
Assigned To: Vitezslav Crhonek
Fedora Extras Quality Assurance
:
: 496987 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-08 05:38 EDT by Stephen Tweedie
Modified: 2009-05-21 19:25 EDT (History)
8 users (show)

See Also:
Fixed In Version: 1.20.4-11.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-21 19:25:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stephen Tweedie 2009-04-08 05:38:25 EDT
Description of problem:
ypbind's latest update adds a ### BEGIN INIT INFO section with insufficient constraints.  As a result, ypbind gets configured to run after autofs, when it *MUST* run before.  And as a result of *that*, boot is completely broken: all filesystems depending on NIS mounts in autofs fail to be set up, user homedirs do not get mounted, login is impossible, etc.

Version-Release number of selected component (if applicable):
ypbind-1.20.4-10.fc10.i386

How reproducible:
100%

Steps to Reproduce:
1. Setup autofs with a NIS map, eg. "+auto.master" in /etc/auto.master, and
an appropriate master NIS map.
2. Boot.
  
Actual results:
Automounted filesystems should be available.

Expected results:
Automounted filesystems do not get set up.

Alternatively:
Steps to Reproduce:
1. yum install ypbind autofs
2. ls -l /etc/rc5.d/

Actual results:
...S28autofs...
...S28ypbind...

Expected results:
...S27ypbind...
...S28autofs...

ie. ypbind *MUST* get started before autofs.

Additional info:
Setting to HIGH severity: this bug essentially breaks the boot process for any user with an autofs map in NIS.

With the current init script, the 
# chkconfig: - 27 73
line is NOT being honoured; even a forced "chkconfig resetpriorities" leaves it at priority 28, the same as autofs (and autofs, coming earlier in the alphabet, therefore runs first.)

Commenting out (or renaming) the ### BEGIN INIT INFO section in the init script fixes the problem for me.
Comment 1 Vitezslav Crhonek 2009-04-08 06:15:50 EDT
Thanks for report (the update was for two or three weeks in testing, I wonder why we have it...).

At the moment LSB Header is NOT required in Fedora and it and it can cause issues with ordering (this situation), so I'll remove it completely.
Comment 2 Fedora Update System 2009-04-08 06:50:46 EDT
ypbind-1.20.4-11.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/ypbind-1.20.4-11.fc10
Comment 3 Vitezslav Crhonek 2009-04-08 07:02:46 EDT
Stephen, please check if it works fine, I'll push it then to the stable ASAP. Thanks!
Comment 4 Stephen Tweedie 2009-04-08 07:37:35 EDT
Looks like it works, at least in part: ypbind is back as S27ypbind in /etc/rc5.d, even after a chkconfig off+on cycle.

But simply doing an rpm update doesn't fix the broken S28ypbind link by itself, it seems: it needed the forced chkconfig cycle to repair that.  

I'm somewhat confused about why updating to ypbind-1.20.4-10.fc10 broke things, while the ypbind-1.20.4-11.fc10 update didn't fix them; does the presence of an LSB header force upstart to re-prioritise the initscript, perhaps?

(This behaviour has been reproduced on two machines, btw.)
Comment 5 Edgar Hoch 2009-04-08 09:27:19 EDT
We have the same problem with S28ypbind with ypbind-1.20.4-10.fc10.

Just a note for discussion:

I see that many scripts in /etc/init.d/* have LSB headers, and others have not.
Maybe the problem is, that chkconfig (I don't know how it works internally) only take notice of init scripts with LSB headers.

So I have tried another method:

/etc/init.d/autofs have no LSB headers. So I added the following LSB headers:

### BEGIN INIT INFO
# Provides: $autofs
# Required-Start: $network $syslog $ypbind
# Required-Stop: $network $syslog $ypbind
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: start|stop|restart|condrestart|reload|status autofs
# Description: Automounts filesystems on demand
### END INIT INFO

"chkconfig ypbind off" and "chkconfig ypbind on" doesn't solve the problem - it still creates S28ypbind.
"chkconfig ypbind resetpriorities" also doesn't change the situation.

But "chkconfig autofs off; chkconfig autofs resetpriorities; chconfig autofs on" then creates S29autofs instead of previous S28autofs.

So - if chkconfig has LSB headers and they describe the right dependencies, then chkconfig generates the right sequence. But if changed on running systems a resetpriorities may be neccessary (I have not tested without that ... - sorry).

In my LSB header example above there should be added also dependencies to other nameservices such as ldap client, not only ypbind (I just used it for testing).

I am not sure what the best method is - removing LSB headers as you did or adding missing LSB headers to the other scripts.
I also had the problem that a script of my own - desclared to start at level 99 (S99*) was started while the network was not ready - so I added LSB headers which seems to solve that problem - but I'm not sure if this was cause.
Comment 6 Edgar Hoch 2009-04-08 09:38:14 EDT
Just as info / addition to my comment #5:

openldap-servers-2.4.12-1.fc10.x86_64 have the same problem.
"chkconfig ldap on" creates /etc/rc5.d/S28ldap, but the chkconfig line in /etc/init.d/ldap tells that it should be S27ldap.

So there should be a solution for this and possible more similar packages too.
Comment 7 Takanori MATSUURA 2009-04-08 21:06:17 EDT
I think removing LSB header in ypbind-1.20.4-11.fc10 is a wrong approach to fix this bug.

The autofs package should add LSB header such as the comment #5.
So this bug should be changed component from ypbind to autofs.
Comment 8 Stephen Tweedie 2009-04-09 04:41:52 EDT
> I think removing LSB header in ypbind-1.20.4-11.fc10 is a wrong approach to fix
> this bug.

That's clearly the better way for rawhide, but for a stable bugfix release I think removing it is fine.  Otherwise we risk there being other latent dependency problems with ypbind, and new ones with autofs.
Comment 9 Vitezslav Crhonek 2009-04-09 07:16:41 EDT
OK, so I prefer to remove LSB header from F10 and let users know that chkconfig cycle is needed to be done (probably in update note/details?).

I can put it back in rawhide if it will be safe (this is also interesting, see https://bugzilla.redhat.com/show_bug.cgi?id=489200#c5). I don't know exact advantage of LSB presence in script. But as it is not required (see https://fedoraproject.org/wiki/Packaging/SysVInitScript#LSB_Header) it will depend on maintainers of relevant packages, whether they will add it.

Another ideas?
Comment 10 Edgar Hoch 2009-04-09 08:17:05 EDT
How will you solve the problem with openldap-servers-2.4.12-1.fc10 ?
It has a simular problem.
We want to move from nis (yp) to ldap in the next weeks,
and autofs also needs a running ldap server if it uses the server on localhost
and autofs maps are in ldap as the used to be in yp.

Now "chkconfig ldap on" creates S28ldap instead of S27ldap as the chkconfig line suggests.

I agree that adding LSB headers to autofs and others may interact with other packages. But we have also this situation. Then the only clear thing would be to touch all Fedora 10 packages with LSB headers in init scripts and remove them for F10. Then you could be sure that other init scripts uses the right start number. This would be a "solution" that will work for all scripts (if the chkconfig lines have the right numbers).

But I think this would be one step back. Many init scripts already have LSB headers, so adding the missing dependencies as we see problems or the dependecies are apparently would be the better way straight forward.

I looked at the wiki page you mentioned and see that we can use some of the system facility names listed there.

Nameservices such as ypbind, ypserv, ldap-servers, etc. should provide $named
and depend on $local_fs $network $syslog and maybe also $portmap.

(I hope I interpret the meaning of that facility right - if $named could be provided by more than one package and to be true all active $named must be started before any script it requires. If that is not right, then we need a facility for each nameservice such as ypbind, ldap, etc., and autofs and the others 

Applications that depend on nameservices such as autofs, nfs, ntpd, etc., should require at least $named, and depending on the application also $local_fs $network $syslog and maybe also $portmap.

So my idea is:
- Leave the LSB headers in the init scripts they already have one.
- Add the eventually missing provides to nameservice packages -
  $named if this works as described above,
  otherwise something like ypbind, ldap, etc for that nameservices
- Add missing requirements to ypbind, ldap-servers, and other nameservice packages - like $local_fs $network $syslog and maybe also $portmap if they need them to start
- Add missing requirements like $named (or ypbind, ldap, etc.) to autofs, nfs, etc. and other services if they need them.
- Add LSB headers to packages like autofs, nfs, etc. that don't have them,
  and use the dependencies described above.
- Check and ensure using a postinstall script, that the priorities are recalculated at least once after installation of the new init scripts.

I think the real problem is not that ypbind depends on others, but autofs and nfs does not declare that the depend on others.
With S29autofs there is no problem with S28ypbind and S28ldap.
So I think autofs (and nfs) is wrong - not ypbind.
Only check if ypbind will provide "ypbind" (oder "$ypbind") or can use the generic "$named" so the other scripts don't need to know all possible nameservices.

Thanks for your attention!
Best regards
Comment 11 Edgar Hoch 2009-04-09 08:48:07 EDT
To comment #10:

Another clear approach would be to modify chkconfig for Fedora 10
to ignore the LSB headers in the init scripts
if you think that Fedora 10 should work this way.

Then all existing LSB headers can remain in the scripts (for future use)
and only the chkconfig lines are respected
and no "wrong" renumbering will appear.

But only removing LSB headers from ypbind will leave the problems on packages with a similar "wrong number" initscript problem.
Comment 12 Ian Kent 2009-04-09 10:29:33 EDT
(In reply to comment #10)
> How will you solve the problem with openldap-servers-2.4.12-1.fc10 ?
> It has a simular problem.
> We want to move from nis (yp) to ldap in the next weeks,
> and autofs also needs a running ldap server if it uses the server on localhost
> and autofs maps are in ldap as the used to be in yp.
> 
> Now "chkconfig ldap on" creates S28ldap instead of S27ldap as the chkconfig
> line suggests.
> 
> I agree that adding LSB headers to autofs and others may interact with other
> packages. But we have also this situation. Then the only clear thing would be
> to touch all Fedora 10 packages with LSB headers in init scripts and remove
> them for F10. Then you could be sure that other init scripts uses the right
> start number. This would be a "solution" that will work for all scripts (if the
> chkconfig lines have the right numbers).
> 
> But I think this would be one step back. Many init scripts already have LSB
> headers, so adding the missing dependencies as we see problems or the
> dependecies are apparently would be the better way straight forward.
> 
> I looked at the wiki page you mentioned and see that we can use some of the
> system facility names listed there.
> 
> Nameservices such as ypbind, ypserv, ldap-servers, etc. should provide $named
> and depend on $local_fs $network $syslog and maybe also $portmap.
> 
> (I hope I interpret the meaning of that facility right - if $named could be
> provided by more than one package and to be true all active $named must be
> started before any script it requires. If that is not right, then we need a
> facility for each nameservice such as ypbind, ldap, etc., and autofs and the
> others 
> 
> Applications that depend on nameservices such as autofs, nfs, ntpd, etc.,
> should require at least $named, and depending on the application also $local_fs
> $network $syslog and maybe also $portmap.
> 
> So my idea is:
> - Leave the LSB headers in the init scripts they already have one.
> - Add the eventually missing provides to nameservice packages -
>   $named if this works as described above,
>   otherwise something like ypbind, ldap, etc for that nameservices
> - Add missing requirements to ypbind, ldap-servers, and other nameservice
> packages - like $local_fs $network $syslog and maybe also $portmap if they need
> them to start
> - Add missing requirements like $named (or ypbind, ldap, etc.) to autofs, nfs,
> etc. and other services if they need them.
> - Add LSB headers to packages like autofs, nfs, etc. that don't have them,
>   and use the dependencies described above.
> - Check and ensure using a postinstall script, that the priorities are
> recalculated at least once after installation of the new init scripts.
> 
> I think the real problem is not that ypbind depends on others, but autofs and
> nfs does not declare that the depend on others.
> With S29autofs there is no problem with S28ypbind and S28ldap.
> So I think autofs (and nfs) is wrong - not ypbind.
> Only check if ypbind will provide "ypbind" (oder "$ypbind") or can use the
> generic "$named" so the other scripts don't need to know all possible
> nameservices.

It seems obvious to me, from the length of this post and the fact
that, while autofs may need various dependencies that shouldn't
be absolutely required, the introduction LSB headers is going to
be a fairly painful process.

I added a first pass at this a while ago in the Rawhide package
and was considering a request to add this to the F-10 package but
now, after reading this, I'm thinking this should be an F-11 or
Rawhide and later innovation.

Note that I have a couple of outstanding bug fixes for autofs in
Rawhide and I'm not even sure whether the LSB stuff has made it to
the revision present in the public repo yet.

Ian
Comment 13 Edgar Hoch 2009-04-09 10:38:39 EDT
Hello Ian,

I understand that autofs has many dependencies and that it may be better to delay the changes to F11.

I have another idea, maybe it will help us for F10 while the dependencies will be resolved for F11?

I want to correct my comment #11 about chkconfig.

Now I think it would be better to change the behavior of chkconfig in a way
that it behaves more like expected
and that init scripts with and without LSB headers can better coexist.

- When recalculating the priorities,
  chkconfig should include the "chkconfig:" entries if they are available:
  - For each pair of init script contains a "chkconfig:" entry,
      build a dependency rule for start priority (S*) that the script with the
lower start number should be started before that with the higher number
      and build a dependency rule for stop priority (K*) that the script with
the lower start number should be started before that with the higher number.
  - If "chkconfig:" entry is available, use that numbers as a start point for
recalculating the priorities, and change it only if dependencies requires it.

It seems to me that chkconfig does not follow this rules now,
but we expect that behavior when LSB headers should be optional like described
in
https://fedoraproject.org/wiki/Packaging/SysVInitScript#LSB_Header .

This can be declared as a bug fix for chkconfig so it can be included in F10 and _should_ not have negative side effects (I hope).

What do you think about that?
May we ask the maintainers of chkconfig what they think about that?
Comment 14 Fedora Update System 2009-04-09 12:11:59 EDT
ypbind-1.20.4-11.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update ypbind'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-3459
Comment 15 Stefan Becker 2009-04-15 01:46:02 EDT
I updated to ypbind-1.20.4-11.fc10 but I still needed to do a chkconfig off+on cycle to get my automounts to work again. I guess this problem can only be fixed by updating the postinstall script to check for an active ypbind service and then run chkconfig off+on.
Comment 16 Vitezslav Crhonek 2009-04-22 01:39:54 EDT
*** Bug 496987 has been marked as a duplicate of this bug. ***
Comment 17 Fedora Update System 2009-05-21 19:25:27 EDT
ypbind-1.20.4-11.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.