hubertf's NetBSD Blog
Send interesting links to hubert at feyrer dot de!
 
[20050923] Observing system startup - Metadata quo vadis?
This is not really about NetBSD, but a rant on what the world is becoming to.

I was looking at various "modern" system startup mechanisms and -replacements, and came across Apple and Sun's FAM which (though different in detail) do not only add metadata in addition to boot scripts, but also use it to manage services that were handled "on demand" by inetd before.

Now, here's what NetBSD (to be on-topic) has in /etc/inetd.conf to run rshd(8) when a service request comes in:

 shell stream tcp nowait root /usr/libexec/rshd rshd -L 
That's one line. I never looked at xinetd, but apparently it was used by Apple before MacOS X 10.4, describing the same thing in another format:
 service shell
 {
 	disable         = yes
 	socket_type     = stream
 	wait            = no
 	user            = root
 	server          = /usr/libexec/rshd
 	groups          = yes
 	flags           = REUSE
 } 
Same data, different format. Not a big deal, but IMHO it's more difficult to keep an overview, as you usually have more than one such service.

Now here's what Apple's "launchd" takes for the same thing:

 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
 "http://www.apple.
 com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
 	<key>Disabled</key>
 	<true/>
 	<key>Label</key>
 	<string>com.apple.rshd</string>
 	<key>ProgramArguments</key>
 	<array>
 		<string>/usr/libexec/rshd</string>
 	</array>
 	<key>inetdCompatibility</key>
 	<dict>
 		<key>Wait</key>
 		<false/>
 	</dict>
 	<key>InitGroups</key>
 	<true/>
 	<key>Sockets</key>
 	<dict>
 		<key>Listeners</key>
 		<dict>
 			<key>SockServiceName</key>
 			<string>shell</string>
 		</dict>
 	</dict>
 </dict>
 </plist>
      
Of course this is all in the name of (machine) readability, because the classic inetd.conf format is harder to read for machines.

One extra bonus to Sun (which also put the startup item metadata into XML files): They don't keep the various services' data in files in a directory as Apple seems to do, but to install a service, you read it into a SQL (SQLite, actually) database, which is then used upon system boot.

Seems the times of readable(!) ASCII config files are ending. While thinking for a long time that Solaris is one of the better things since sliced bread, their new start up system in Solaris 10 made me turn away.

--

References: "Getting started with launchd", Solaris' svc.startd(8) and smf(5).

[Tags: , , ]


Disclaimer: All opinion expressed here is purely my own. No responsibility is taken for anything.

Access count: 34980747
Copyright (c) Hubert Feyrer