When you install a new Linux server distribution, you can often install all of the daemons you’ll need to run on that machine at install time. Distribution vendors present a “ready to go” distribution by supplying initialization scripts for all of the services you might run. But what happens if you’re building from source, and no init script is supplied? What if you’re writing the source and haven’t ever built an init script? Here are a few ways to cope when you’re faced with this challenge.
This information is not relevant for Gentoo users.
The Gentoo Developers have provided excellent documentation of initscripts and runlevels.
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=…
Well, it is relevent in the sense that there are many Gentoo users (just as there are many users of various distributions) that don’t realize that they can play with the behavior of their init system, that there are useful reasons to do so, and that it isn’t as daunting as they might think. Your post and link makes this information relevent to Gentoo users, and for that you get modded up by a longtime Gentoo user (since 1.0-rc5).
In addition, curious non-Gentoo users who check out the link will notice that: 1) Gentoo’s documentation is outstanding, that it has been outstanding since the very early days of the project, and that there is an extreme focus on maintaining and improving the quality of the documentation. 2) Gentoo’s init system, while not compatible with the traditional SysV or BSD systems, is very well thought out and easy to use (and by comparison to the Red Hat tutorial, significantly easier than the Red Hat way). 3) That if working with Gentoo’s init system is so straightforward, then maybe that stuff I read about Gentoo being too hard in general for the average Linux user to consider is overblown?
No, you don’t need to compile everything (use the GRP).
No, you don’t need to configure everything (just your filesystem layout, architecture, hostname, timezone, and bootloader).
No, you don’t need to configure your kernel (use genkernel).
No, you don’t need X to install someserverpackage (use USE=”-X”).
No, you don’t need to install in text mode (I use the Ubuntu LiveCD these days).
…but you can if you want. And where Gentoo differs from other Linux distributions (package management, init scripts, config file layout, etc.) it do so because it’s more powerful, more flexible, and makes more sense.
I think it’s a bit sad that there are so few daemons that are designed to work the djb way[1]
Anyone know why this is so uncommon?
[1] http://www.thedjbway.org/
Would have been nice if they’d discussed the merits of different init approaches. This appears to be a system V init. There are some nice alternative approaches being invented which better support things like parallel boot, etc.
If you look carefully at the example init-script, you’ll see something like this:
touch /var/lock/subsys/ns-ldap
Be aware that if this file doesn’t exist, the daemon WILL NOT be stopped at shutdown/reboot. This can be potentially hazardous, if your application does essential cleanup at shutdown.
Likewise, if this file exists at boot, many daemons WILL NOT start.