FS#20903 - [nfs-utils][initscripts] Daemons in DAEMON_DEPENDS are stopped to early

Attached to Project: Arch Linux
Opened by Paul Ezvan (paulez) - Tuesday, 21 September 2010, 14:36 GMT
Last edited by Tobias Powalowski (tpowa) - Friday, 26 August 2011, 14:42 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Tom Gundersen (tomegun)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
Daemons listed in DAEMON_DEPENDS of an daemon initscript are stopped first when system is shutdown.
For exemple, nfs-common has rpcbind in DAEMON_DEPENDS. When the system is shutdown, rpcbind is stopped first. Then network filesystems cannot be unmounted because of nfs server being unresponsive, resulting in a long delay (waiting for timeout) before stopping.
Rpcbind should stop just before nfs-common to resolve this.

Steps to reproduce:
- Configure nfs mount in fstab
- adding nfs-common in rc.conf before netfs
- at shutdown nfs shares cannot be unmounted.
This task depends upon

This task blocks these from closing
 FS#24843 - Do not start daemons from other daemons 
Closed by  Tobias Powalowski (tpowa)
Friday, 26 August 2011, 14:42 GMT
Reason for closing:  Fixed
Additional comments about closing:  1.2.4-3
Comment by Tom Gundersen (tomegun) - Monday, 06 June 2011, 00:02 GMT
This is a general problem with DAEMON_DEPENDS.

On shutdown, daemons pulled in through DAEMON_DEPENDS are treated the same as daemons started manually. That is to say they are shutdown first, before the daemons in the DAEMONS array are stopped.

We should probably fix this. Until it is fixed, it would be best if DAEMON_DEPENDS are not used, and users instead are adviced to add the needed daemons to their rc.conf, in the correct order:

DAEMONS=(... rpcbind nfs-common ...)

Then we know to stop rpcbind last.
Comment by (N/A) (wantilles) - Monday, 06 June 2011, 12:08 GMT
OK I know nfs-common should be after rpcbind.

But should it before, or after, netfs?
Comment by Tom Gundersen (tomegun) - Monday, 06 June 2011, 12:28 GMT
netfs does the mounting, so that needs to go last.
Comment by Tom Gundersen (tomegun) - Thursday, 23 June 2011, 22:50 GMT
@tpowa: I suggest removing the ck_depends stuff and adding instead:

if ! ck_daemon rpcbind; then
echo "ERROR: Refusing to start nfs-common without rpcbind running!" >&2
stat_die
fi

We would of course also need to notify the users to add rpcbind to their rc.conf. However, if they don't have rpcbind in rc.conf already they will have a hang on shutdown anyway...
Comment by Tom Gundersen (tomegun) - Friday, 26 August 2011, 14:09 GMT
As pointed out by Gaetan, my suggestion is wrong (the negation should not be there). This sholud work:

ck_daemon rpcbind && { echo -n "Start rpcbind first." >&2; stat_die; }

(Taken from the avahi package, but not tested myself (just like the previous one was taken from the hal package without testing it myself...)).

Loading...