launchd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
launchd [2011/05/24 19:02] – Remove link to outdated tarball: the p4 stuff is only fr reference and the GitHub stuff is more up to date. PedroGiffunilaunchd [2021/04/02 08:18] (current) – Fix 2 links. Remove 5 broken hyperlinks. Add 1 note. Link to 1 new page. Replace 1 link with internal page. SashaVigole
Line 1: Line 1:
 ====== Launchd ====== ====== Launchd ======
  
-Mac OS X 10.4 Tiger introduced a new program called //launchd//. This Wiki page tries to collect the results for the Google Summer of Code 2005 Project to bring it to %%FreeBSD%%. Information may be very outdated.+Mac OS X 10.4 Tiger introduced a new program called //launchd//.
  
-[[http://video.google.com/videoplay?docid=9134517895937683240#|Launchd: One Program to Rule them all]]  //(Google Video)//+[[https://www.youtube.com/watch?v=mLwn_TbBntI|Launchd: One Program to Rule them all]]  //(%%YouTube%%)// 
 + 
 +%%FreeBSD%% machines can have uptimes anywhere between months and years, and that makes it all the more critical when they go down (for maintenance of course). To where every second of downtime can be lost business, or lost time for a development team that uses a centralized server. By porting launchd(8) to %%FreeBSD%% 6-CURRENT, boot up times and job management can both be handled more effectively, and improve some aspects of the operating system itself. 
 + 
 +This has the possibility, if merged into the source tree, of improving overall boot times for all %%FreeBSD%% users, from those desktop users, to firewalls, to critical servers. It also benefits the system, with it's simplicity, launchd(8) replaces: init, rc, the init.d and rc.d scripts, %%SystemStarter%% (Mac OS X specific),  inetd and xinetd, atd, crond, and watchdog, into one centralized daemon.
  
 ==== Updates ==== ==== Updates ====
  
-  * 20080921: A %%FreeBSD%% port has been spotted on [[https://github.com/rtyler/launchd-for-freebsd|Github]] +  * 20151115: Mark Heily announced relaunchd (new project repo: [[https://github.com/mheily/jobd|jobd]]): a portable clone of launchd. 
-  * 20060906: Launchd Subversion Repository Available at [[http://launchd.macosforge.org|MacOSForge]]. +  * 20150730: Meet [[http://www.nextbsd.org|NextBSD]], which carries a full fledged port of launchd 
 +  * 20150629: The %%TrueOS%% fork of %%FreeBSD%% 10 has launchd running as init and a JSON-aware launchctl utility, along with notifyd, libdispatch and ASL integrated. This work has also been forward-ported to %%FreeBSD%% -CURRENT. %%FreeNAS%% 10, which is also based on %%FreeBSD%% 10.1, will be using launchd and a host of other tools ported from OS X / iOS.  It has used the original, and latest, Apple sources and ported them along with MACH IPC. 
 +  * 20140910: Outback Dingo has made available an older port of pfSense's launchd_xml (new page: [[launchd|launchd]]) 
 +  * 20131211: There is a new [[https://github.com/freebsd/openlaunchd|Open Launchd]] project with a corresponding Google group ((''%%groups.google.com/forum/#!forum/openlaunchd%%'')). 
 +  * 20080921: A %%FreeBSD%% port has been spotted on [[https://github.com/freebsd/openlaunchd|Github]] 
 +  * 20060906: Launchd Subversion Repository Available at %%MacOSForge%% ((''%%https://web.archive.org/web/20120918023721/http://launchd.macosforge.org:80/%%'')) (archive.org).
   * 20060807: Launchd Adopts Apache License, Version 2.0!   * 20060807: Launchd Adopts Apache License, Version 2.0!
 +  * 20051101: Recently merged code snapshot from zarzycki@Apple into perforce ((''%%p4web.freebsd.org/@md=d&cd=//depot/projects/soc2005/&c=HVG@//depot/projects/soc2005/launchd/?ac=83%%'')) directory.
  
-  * 20051101: Recently merged code snapshot from zarzycki@Apple into [[http://p4web.freebsd.org/@md=d&cd=//depot/projects/soc2005/&c=HVG@//depot/projects/soc2005/launchd/?ac=83|perforce]] directory (A working tarball snapshot of launchd(8) for %%FreeBSD%% is on the way)+===== 2005 GSoC Project Details ===== 
 +The launchd(8) ((''%%http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/launchd.8.html%%'')) (removed old manpage in the footnote) project was originally released under the APSL (Apple Public Source License) by Apple Computers Inc., along with its release of Mac OS 10.4. It has helped dramatically improve boot times of Mac OS X, and would be very valuable to have elsewhere in the open source community. Politics may be a problem with its acceptance into the base system of %%FreeBSD%%, given that it is neither BSD licensed nor part of the necessary GNU code in the %%FreeBSD%% base system. Another problem that may present itself would be that launchd(8) uses an XML configuration file, depending on how things go, it may be simpler to go with a more "traditional" .conf configuration file. The main goal of the project is to port the program, to where it can plausibly replace ancient unix utilities, such as 'cron', xinetd/inetd, atd, and watchdog. Giving system administrators, and individual users alike a simple administration point to manage most of the system daemons that are "usually" run automatically. 
 + 
 +===== Deliverables ===== 
 +  * Speed up %%FreeBSD%% boot times noticeably. (to where there isn't a doubt that launchd(8) has made a definite effect on boot times) 
 +  * Create a script, or other method for converting rc.d scripts from ports that a user installs, for launchd(8)'s use. 
 +  * Port launchd(8) first as a user-land daemon, replacing init as PID 1 to be done later (as in, not within the scope of this project) because of certain complexities involved. 
 +  * Reduce dependency on rc.d scripts as much as is feasibly possible, to where any rc.d scripts that still need to exist are started simultaneously along with the rest of the daemons that launchd(8) manages.  
 +  * Create a centralized management point for many of the duties that older unix daemons (cron, atd, watchdog, etc) formerly did.
  
 ==== 2005 - End of Summer Synopsis ==== ==== 2005 - End of Summer Synopsis ====
Line 20: Line 37:
  
 **In the future** **In the future**
-As it stands right now, the code is still somewhat, well, very, unpolished. I'll take the blame on that one. I still intend on writing a plist format (the non-XML one) parser to incorporate into the code base, which will give users full advantage of everything launchd(8) can do, while maintaining backwards compatibilty with launchd/%%MacOS%%. Work also is about 40% done on the init(8) replacement part of launchd(8), but since the %%FreeBSD%% organization isn't as anal retentive about daemon count as Apple Inc. apparently was, it's not _as_ necessary (but I still intend to port it over soon enough, the orig. launchd(8) incorporates a lot of mach_init oddness) In all honesty, I don't think launchd(8) will be anything to brag about until, maybe this winter, but the hardest part is definitely behind me, wrapping my little 19 year old brain around this code was quite a feat, but I think I have a good feel for how everything works, and why. (MANY thanks to zarzycki@apple.com in this regard, he held my hand through a lot of the tougher parts ;%%))%%+As it stands right now, the code is still somewhat, well, very, unpolished. I'll take the blame on that one. I still intend on writing a plist format (the non-XML one) parser to incorporate into the code base, which will give users full advantage of everything launchd(8) can do, while maintaining backwards compatibilty with launchd/%%MacOS%%. Work also is about 40% done on the init(8) replacement part of launchd(8), but since the %%FreeBSD%% organization isn't as anal retentive about daemon count as Apple Inc. apparently was, it's not _as_ necessary (but I still intend to port it over soon enough, the orig. launchd(8) incorporates a lot of mach_init oddness) In all honesty, I don't think launchd(8) will be anything to brag about until, maybe this winter, but the hardest part is definitely behind me, wrapping my little 19 year old brain around this code was quite a feat, but I think I have a good feel for how everything works, and why. (MANY thanks to zarzycki@apple in this regard, he held my hand through a lot of the tougher parts ;%%))%%
  
 **Licensing** **Licensing**
-Yes, yes, yes, this is still the APSL, which I can't help, maybe after I have a better working alpha, beta, or gamma(?) release of this, it'll be more appropriate to campaign to Apple to get a BSDL version as to allow minimal flaming when I try to squeeze launchd(8) into the base system (post-init replacement). //(This has changed, be sure to check the updates section.)// 
  
-===== Project Description ===== +As mentioned in the "Updates" section, this has changed from APSL to [[http://www.apache.org/licenses/LICENSE-2.0.html|Apache Version 2 license]].
-Improving %%FreeBSD%% boot times, and manageability with [[http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/launchd.8.html|launchd(8)]] +
- +
-===== Synopsis ===== +
-%%FreeBSD%% machines can have uptimes anywhere between months and years, and that makes it all the more critical when they go down (for maintenance of course). To where every second of downtime can be lost business, or lost time for a development team that uses a centralized server. By porting launchd(8) to %%FreeBSD%% 6-CURRENT, boot up times and job management can both be handled more effectively, and improve some aspects of the operating system itself. +
- +
-This has the possibility, if merged into the source tree, of improving overall boot times for all %%FreeBSD%% users, from those desktop users, to firewalls, to critical servers. It also benefits the system, with it's simplicity, [[http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/launchd.8.html|launchd(8)]] replaces: init, rc, the init.d and rc.d scripts, SystemStarter (Mac OS X specific),  inetd and xinetd, atd, crond, and watchdog, into one centralized daemon.+
  
 ===== Milestones ===== ===== Milestones =====
   * [finished] Remove all of the dependencies on autoconf/automake (in favour of a BSD-styled build system)    * [finished] Remove all of the dependencies on autoconf/automake (in favour of a BSD-styled build system) 
-  * [finished] Use launchctl as a test subject for removing the CoreFoundation hooks and API calls     +  * [finished] Use launchctl as a test subject for removing the %%CoreFoundation%% hooks and API calls     
-  * [finished] Strip out CoreFoundation calls from the main launchd(8) code +  * [finished] Strip out %%CoreFoundation%% calls from the main launchd(8) code 
   * [finished] Be able to compile the core utilities of launchd(8) on any %%FreeBSD%% 6.xx system.    * [finished] Be able to compile the core utilities of launchd(8) on any %%FreeBSD%% 6.xx system. 
   * [finished] Allow launchd(8) to assume a non-PID-1 role, i.e., as a regular daemon, not _the_ daemon   * [finished] Allow launchd(8) to assume a non-PID-1 role, i.e., as a regular daemon, not _the_ daemon
Line 43: Line 53:
   * [work in progress] Start to make it _work_ as PID 1   * [work in progress] Start to make it _work_ as PID 1
   * [work in progress] document code? *gasp* ;)   * [work in progress] document code? *gasp* ;)
- 
-===== Deliverables ===== 
-  * Speed up %%FreeBSD%% boot times noticeably. (to where there isn't a doubt that launchd(8) has made a definite effect on boot times) 
-  * Create a script, or other method for converting rc.d scripts from ports that a user installs, for launchd(8)'s use. 
-  * Port [[http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/launchd.8.html|launchd(8)]] first as a user-land daemon, replacing init as PID 1 to be done later (as in, not within the scope of this project) because of certain complexities involved. 
-  * Reduce dependency on rc.d scripts as much as is feasibly possible, to where any rc.d scripts that still need to exist are started simultaneously along with the rest of the daemons that launchd(8) manages.  
-  * Create a centralized management point for many of the duties that older unix daemons (cron, atd, watchdog, etc) formerly did. 
- 
-===== Project Details ===== 
-The [[http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/launchd.8.html|launchd(8)]] project was released under the APSL (Apple Public Source License) by Apple Computers Inc. recently, along with its most recent release of Mac OS 10.4. It has helped dramatically improve boot times of Mac OS X, and would be very valuable to have elsewhere in the open source community. Politics may be a problem with its acceptance into the base system of %%FreeBSD%%, given that it is neither BSD licensed nor part of the necessary GNU code in the %%FreeBSD%% base system. Another problem that may present itself would be that launchd(8) uses an XML configuration file, depending on how things go, it may be simpler to go with a more "traditional" .conf configuration file. The main goal of the project is to port the program, to where it can plausibly replace ancient unix utilities, such as 'cron', xinetd/inetd, atd, and watchdog. Giving system administrators, and individual users alike a simple administration point to manage most of the system daemons that are "usually" run automatically. 
- 
-==== Bio ==== 
-I am Robert Tyler Ballance, currently a Computer Engineering major at Texas A&M University. I've been active in the BSD community for a year or two. (Was a core member of the ekkoBSD team in a past life as well.) Along with my open source efforts in the BSD community, my job for the university directly involves %%FreeBSD%%, the newest bit of %%OpenBSD%%/pf code in %%FreeBSD%%-CURRENT, and the new if_bridge code in -CURRENT as well. 
- 
-==== Email ==== 
-R. Tyler Ballance       <tyler@monkeypox.org> 
  
  • launchd.1306263767.txt.gz
  • Last modified: 2011/05/24 19:02
  • by PedroGiffuni