Dealing with boot dependencies as Squeeze installs them is not always that easy. After installation of this box I had to install NIS and a user program which runs in the background, but needs credentials obtained thru NIS. The user program should start during boot as well.
The header of the NIS startup script looked like:
Code:
### BEGIN INIT INFO
# Provides: ypbind ypserv ypxfrd yppasswdd
# Required-Start: $network $portmap
# Required-Stop: $portmap
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
But NIS would not start at boot time. After a terrible long timeout delay booting would continue. Looking at the on-screen messages, it appeared that
network-manager had to run before NIS would start. That is strange, as the virtual dependency
$network had to be satisfied as well. Anyway, after modifying the header to this:
Code:
### BEGIN INIT INFO
# Provides: ypbind ypserv ypxfrd yppasswdd
# Required-Start: $network $portmap network-manager
# Required-Stop: $portmap
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
That made NIS run, but not my own script. This scripts header was:
Code:
### BEGIN INIT INFO
# Provides: detect_gate
# Required-Start: $network $portmap
# Required-Stop: 1
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
Because NIS was started later after network-manager was started, my own script failed to start, because the script used credentials only available thru NIS.
This would not help either:
Code:
### BEGIN INIT INFO
# Provides: detect_gate
# Required-Start: $network $portmap network-manager
# Required-Stop: 1
as now NIS and my script would start concurrently.
No, this would not do the trick either, as a matter of fact update-rc.d would not even install the script:
Code:
### BEGIN INIT INFO
# Provides: detect_gate
# Required-Start: $network $portmap nis
# Required-Stop: 1
because NIS is not a package. Look in the NIS script and look at the
Provides line.
The solution was of course the specify the package
Provided by NIS:
Code:
### BEGIN INIT INFO
# Provides: detect_gate
# Required-Start: $network $portmap ypbind
# Required-Stop: 1
Now everything is fine, and booting is very fast, a significant improvement from the old system. I hope I solved this in the right way. Also I am not sure this is a bug which should be filed against the NIS installation package.
jlinkels