Showing posts with label insserv. Show all posts
Showing posts with label insserv. Show all posts

Saturday, April 9, 2011

Insserv: The Final Word

I updated my two Debian sid systems to insserv and dependency based booting today. The update was on hold for so long (over a year!) that it was growing a fungus. ^_^

After the positive experience with the Debian squeeze upgrade, and the fact that some packages are now depending on insserv (shudder), I decided that not updating was likely to become troublesome in the near future. The one thing that you should never do on Linux, is fight against the package dependencies, even if you don't agree with them. Thither lies dependency hell. Trust me, you have better things to do.

Hopefully, this will be the final word on insserv. Unless it breaks, of course. ^_^

Tuesday, April 5, 2011

Insserv

Understanding insserv was easy enough but I am still not convinced that dependency based booting should be the default. It is a choice best left to the sysadmin. Anyhow, what's done, is done.

I solved the problem of NFS depending on DNS by creating an override file in /etc/insserv/overrides/nfs-kernel-server:
### BEGIN INIT INFO
# Provides: nfs-kernel-server
# Required-Start: $remote_fs nfs-common $portmap $time $named
# Required-Stop: $remote_fs nfs-common $portmap $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Kernel NFS server support
# Description: NFS is a popular protocol for file sharing across
# TCP/IP networks. This service provides NFS server
# functionality, which is configured via the
# /etc/exports file.
### END INIT INFO
and running
# insserv nfs-kernel-server
to update the start up order.

My rtorrent initscript is based on this one, which does not have the dependency header that insserv requires. I used the header from the initscript included in the SABnzb+ package since it seemed reasonable that rtorrent would have the same requirements. I inserted the following into the rtorrent initscript:
### BEGIN INIT INFO
# Provides: rtorrent
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: rtorrent BitTorrent client
### END INIT INFO
and ran
# insserv rtorrent.sh
to activate the script. I didn't bother using an override file since the script is not part of a package.

And thus ended my first squeeze upgrade. Extrapolating this experience, my customer's servers, which are very heavily customized, will likely require much more work than the previous upgrade. Oh, joy!

Monday, April 4, 2011

Progress (Or Is It?)

I upgraded one of my Debian servers to 6.0 (squeeze) today. This system is currently not that critical (it won't kill me if I can't watch TV ^_^) but it is about to become my new mail server, so this seemed like an appropriate time to do the upgrade.

The upgrade went smoothly but I miss the the good old days when a Debian upgrade consisted of three steps: change sources.list, run "apt-get update", and run "apt-get dist-upgrade". Although the upgrade completed successfully, there are still a few bits to be ironed out.

One of the problems is that the new dependency based initscript system (insserv) causes the NFS export to fail, because the DNS server has not started yet. The old System-V-like system never had this problem. The easiest solution is to use IP address in the /etc/exports file, but hard coding IPs seems backwards to me, so it looks like I'll be digging into the mysteries of insserv.

This is OK, since I have have a custom initscript which also has to be integrated with insserv, so learning it was unavoidable. The mildly annoying part is that insserv is already slated to be replaced in the next Debian release. It says a lot about the old, equally broken but well understood, System-V style startup which had been around since forever. Ah, progress!