10.4: Force use of launchd for upgraded installs

May 15, '05 10:33:00AM

Contributed by: geohar

Tiger only hintIf you upgraded to 10.4, rather than doing a fresh install (or archive and install), then you're probably (see note below) still launching all your daemons (ssh, for example) via xinetd, which is deprecated. Apple provided support for xinetd in upgraded distributions so that things didn't break, but you may want the latest and greatest. All I'm suggesting here is to match what a fresh 10.4 install does.

Note: I only have one system here, where I'd installed an extra service into /etc/inetd.d, which may have prompted the usage of xinetd rather than launchd. My reading of the installer scripts, though, is that any upgraded install of 10.4 will use xinetd, rather than launchd. Fresh installs are confirmed to have a blank /etc/xinetd.d directory.

The Sharing preference pane in Sytem Preferences can use either launchd or xinetd for things like ssh, but xinetd will take preference if it's there. We'll move the files out of the way, so that launchd is used instead.

Quit System Preferences, and then do the following in the Terminal:

$ sudo mkdir /etc/xinetd.d.bak
$ sudo mv /etc/xinetd.d* /etc/xinetd.d.bak/
This backs up your old etc/xinetd.d directory to /etc/xinetd.d.bak so you can revert, and so you can convert any additional services you added to launchd's plist format. To convert any services you added, look at man launchd, or Apple's Introduction to System Startup Programming Topics article. These items should be added to /Library/LaunchDaemons, and will be examined on boot, or if you do this:
$ sudo launchctl load /Library/LaunchDaemons/new_service_name.plist
Load System Preferences, and go to Sharing. You'll need to re-enable any services you want turned on. Reboot. Voila -- xinetd won't bother booting, and everything loads via the latest and greatest (launchd).

Comments (18)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050504185019359