Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Force use of launchd for upgraded installs System 10.4
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).
    •    
  • Currently 2.60 / 5
  You rated: 3 / 5 (5 votes cast)
 
[13,867 views]  

10.4: Force use of launchd for upgraded installs | 17 comments | Create New Account
Click here to return to the '10.4: Force use of launchd for upgraded installs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Force use of launchd for upgraded installs
Authored by: mistertim on May 15, '05 06:39:40PM

How do you know which one is being used to launch services? Is there any way of telling whether launchd or xinetd is being used?



[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: geohar on May 16, '05 04:13:58AM
Simplest way is to do

cp /etc/xinetd.d/ssh ~/xinetd_ssh_old

<go to sharing prefs, toggle ssh's on/off setting>

diff /etc/xinetd.d/ssh ~/xinetd_ssh_old

<check for a difference>

rm ~/xinetd_ssh_old
of course, if /etc/xinetd.d/ is empty, launchd is used. If you see differences, then xinetd is being used (as will be the case if /etc/xinetd.d/ isn't empty).

[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: stingerman on May 15, '05 08:22:22PM

I followed your instructions on both my iBook and PowerMac G5 and I don't know if something is wrong but everything is a lot snappier! Boot up time is super quick and apps in general seem to be on adrenaline. Is that possible?

Too, instead of "sudo mv /etc/xinetd.d* /etc/xinetd.d.bak/" did you mean:

sudo mv /etc/xinetd.d/* /etc/xinetd.d.bak/ (notice the additional "/" in the first parameter).



[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: jedik on May 15, '05 09:23:49PM

I upgraded to Tiger and followed the instructions given in the hint. Indeed, my system seems snapier now. Very good! Thanks. :)

---
:: Jedi Knight ::
-- Mac Rules! --



[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: papastanley on May 16, '05 01:10:37AM

...likely he does mean xinetd.d* as this will get the xinetd.d directory and also the conf files etc.

papa



[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: MacOfTheEast on May 16, '05 05:59:17PM

Why not just...

mv /etc/xinetd.d /etc/xinetd.d.bak

...to simply rename the entire directory without having to make a new backup directory first?



[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: geohar on May 16, '05 04:17:01AM

Good catch. The extra slash means only the contents of /etc/xinetd.d/ get moved - though I don't think moving the xinetd conf files will harm.

Rob, could you ammend the hint?



[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: whytoi on May 16, '05 01:49:00AM
So there really is a difference b/n upgraded Tiger and clean installed versions. How interesting. So apart from what some have reported in terms of speed of boot up, what other tangible differences are there for the average non-CLI users? Any other effects on the performance of the OS on the GUI end?

[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: stingerman on May 16, '05 08:22:16AM

I noticed that Tiger in general is snapier with just launchd. Maybe because of quicker process launches and more efficient use of resources.



[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: SentientToad on May 16, '05 06:28:48AM
You can disable xinetd altogether by disabling its plist entry for launchd. The easiest way to do this is

sudo launchctl unload -w /System/Library/LaunchDaemons/org.xinetd.xinetd.plist
This adds

     <key>Disabled</key>
          <true/>
to the plist file as well as unloading xinetd.

Now launchd won't start it on system boot. To re-enable it,


sudo launchctl load -w /System/Library/LaunchDaemons/


[ Reply to This | # ]
Oops, typo ...
Authored by: SentientToad on May 16, '05 06:30:39AM
To re-enable type

sudo launchctl load -w /System/Library/LaunchDaemons/org.xinetd.xinetd.plist


[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: johnts on May 16, '05 12:19:32PM

I just tried this. When I entered the command, the xinetd daemon did go away, but when I went to try and FTP into my system, i got an error. I turned off and back on FTP (and remote login) and was able to log in.

However. xinetd is running again. Entering the launchctl command now returns:

No such process

and yet ps -ax| grep xin shows:

474 ?? Ss 0:00.03 /usr/sbin/xinetd -pidfile /var/run/xinetd.pid

The .plist for xinetd does show the Disabled key is in there.



[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: johnts on May 16, '05 12:22:44PM

Hm. Maybe I just misunderstood. When I stop the FTP or remote login service, xinetd does go away.

I guess xinetd is needed for those services, it's just not running all the time to control other services.



[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: geohar on May 16, '05 01:25:45PM

For sure, but you _still_ need to remove the contents of /etc/xinetd.d/ in order that system prefs uses launchd, rather than xinetd. Simply disabling xinetd will not work.

Additionally, it's probably worth noting that xinetd will not run unless something is put into /etc/xinetd.d (launchd watches for this and launches it - beacause launchd is actually used to launch xinetd!!).

As xinetd doesn't run unless there's something in the directory for it to run on, it's probably worth leaving it 'enabled' in it's launchd plist - that way, if an installer puts something there, it'll run fine. The rest will still use launchd, because their /etc/xinetd.d/ entries will be missing.



[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: robtain on May 16, '05 01:11:06PM

Hi geohar,

I tried your tip and while my system seems to be running and most services are there, finding my localhost web site by using the Bonjour name seems to take forever (i.e. several minutes) while using the IP address results in instantaneous loading of the site.

Any ideas?

Rob



[ Reply to This | # ]
10.4: Force use of launchd for upgraded installs
Authored by: geohar on May 16, '05 01:32:53PM
Not quite sure why that would be. mDNSResponder (the bonjour service dns agent) is always run from launchd - there was no xinetd equivalent, so the hint shouldn't have affected it. Apache itself is also always run as a startup item (/System/Library/StartupItems/Apache) I don't think it's requests are ever serviced by launchd in the current 10.4.0 for efficiency reasons.

Have you restarted?

Might also be worth looking in top at any processes which are taking up cpu time when you do a lookup.

[ Reply to This | # ]

10.4: Force use of launchd for upgraded installs
Authored by: logo on May 18, '05 03:45:40AM

Beware!

This hint disabled my postfix pop3 service, that I set up using postfix enabler.
Apparently postfix enabler uses /etc/xinetd.d to store it's pop3-service.

As soon as I moved xinetd.d.bak to xinetd.d all was back to normal,

slower though :-(



[ Reply to This | # ]