Apple provides a program called SystemStarter which is used to start and stop scripts in the /System -> Library -> StartupItems and /Library -> StartupItems folders. You can use it to restart services like so:
% sudo SystemStarter restart NetInfoOr if you've just installed GimpPrint and need to restart CUPS for it to find your printer:
% sudo SystemStarter restart PrintingServicesThe one caveat is that all the start, stop, and restart options do is pass this argument to the various scripts. If the script doesn't respond to that argument, nothing happens. An example is AppServices, which controls coreservicesd. Sending stop or restart to this script has no effect.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20021003061516722