[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: insserv: /home on NFS and local bind (DNS lookups fail on boot)



Camaleón <noelamac@gmail.com> writes:
> Did you read the manual or the docs for insserv? Maybe we are missing some 
> step to fully populate the new boot sequence :-?

I did try but the man page does not really mention when symlinks are
created. For example

$ echo /etc/rc*/*bind9
/etc/rc0.d/K02bind9 /etc/rc1.d/K02bind9 /etc/rc2.d/S19bind9 /etc/rc3.d/S19bind9 /etc/rc4.d/S19bind9 /etc/rc5.d/S19bind9 /etc/rc6.d/K02bind9
$ sudo rm /etc/rc*/*bind9
$ sudo insserv
$ echo /etc/rc*/*bind9
/etc/rc*/*bind9

does not seem to recreate them but

$ sudo update-rc.d bind9 enable
update-rc.d: using dependency based boot sequencing
update-rc.d: error: no runlevel symlinks to modify, aborting!
$ sudo ln -s ../init.d/bind9 /etc/rc2.d/S20bind9
$ sudo update-rc.d bind9 enable
update-rc.d: using dependency based boot sequencing
insserv: warning: current start runlevel(s) (2) of script `bind9' overwrites defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (empty) of script `bind9' overwrites defaults (0 1 6).
$ echo /etc/rc*/*bind9
/etc/rc2.d/S19bind9

does (and note how S20 was turned into S19). A way to "regenerate"
symlinks for all runlevels thus becomes

$ sudo update-rc.d -f bind9 remove
update-rc.d: using dependency based boot sequencing
$ sudo update-rc.d bind9 defaults
update-rc.d: using dependency based boot sequencing
$ echo /etc/rc*/*bind9
/etc/rc0.d/K02bind9 /etc/rc1.d/K02bind9 /etc/rc2.d/S19bind9 /etc/rc3.d/S19bind9 /etc/rc4.d/S19bind9 /etc/rc5.d/S19bind9 /etc/rc6.d/K02bind9

If instead of changing "+bind9" to "bind9" in /etc/insserv.conf I
change

# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Should-Start:      $network $syslog
# Should-Stop:       $network $syslog

to

# Required-Start:    $local_fs
# Required-Stop:     $remote_fs
# Should-Start:      $network
# Should-Stop:       $network $syslog

in /etc/init.d/bind9 then I do get desired ordering in runlevel 0:

$ echo /etc/rc*/*bind9
/etc/rc0.d/K02bind9 /etc/rc1.d/K02bind9 /etc/rc2.d/S01bind9 /etc/rc3.d/S01bind9 /etc/rc4.d/S01bind9 /etc/rc5.d/S01bind9 /etc/rc6.d/K02bind9
$ echo /etc/rc*/*mountnfs.sh
/etc/rc0.d/K05umountnfs.sh /etc/rc6.d/K05umountnfs.sh /etc/rcS.d/S16mountnfs.sh

This, however, does not help since mountnfs.sh is run already in
runlevel S. As an exercise I added bind9 to Required-Start of
/etc/init.d/mountnfs.sh

$ sudo update-rc.d -f mountnfs.sh remove
update-rc.d: using dependency based boot sequencing
$ sudo update-rc.d mountnfs.sh defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: mountnfs.sh start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (S)
update-rc.d: warning: mountnfs.sh stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (none)
$ echo /etc/rc*/*mountnfs.sh
/etc/rc0.d/K05umountnfs.sh /etc/rc6.d/K05umountnfs.sh /etc/rcS.d/S16mountnfs.sh

but mountnfs still gets started in S runlevel and thus before
bind9. Next, I changed Default-Start of /etc/init.d/mountnfs.sh from
"S" to "2" and finally bind9 seems to start before mountnfs.sh:

$ echo /etc/rc*/*mountnfs.sh
/etc/rc0.d/K05umountnfs.sh /etc/rc2.d/S16mountnfs.sh /etc/rc6.d/K05umountnfs.sh
$ echo /etc/rc*/*bind9
/etc/rc0.d/K02bind9 /etc/rc1.d/K02bind9 /etc/rc2.d/S01bind9 /etc/rc3.d/S01bind9 /etc/rc4.d/S01bind9 /etc/rc5.d/S01bind9 /etc/rc6.d/K02bind9

I have a feeling that there must be a better way but I'll do a test
boot next...


Reply to: