Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Does launchd Beat cron?

timothy posted more than 9 years ago | from the borrowable dept.

Utilities (Apple) 798

Blamemyparents writes "For those who aren't Appleheads, you may not have heard that with Tiger, Apple swapped out old Unix standby cron for their own creation, launchd (Apple mentions it on their OS X page and has the man page for it up as well). Seems like it's a bit nerdy, but this changes a LOT about how *nix systems have done things for many years. Launchd is Apple's replacement for quite a few utilities, including launching and quitting quite a few different things, and getting info from the system and other running processes. This page from Ars Technica talks a bit more in depth about it. Apple has open sourced the thing, and is apparently hoping all the unix kids will take a look."

cancel ×

798 comments

Sorry! There are no comments related to the filter you selected.

sweetness (0)

xjeff (409609) | more than 9 years ago | (#12399857)

Yeah, this looks really cool (being a unix geek and all). I hope this catches on.

Re:sweetness (1, Insightful)

justsomebody (525308) | more than 9 years ago | (#12399991)

Looks cool? Based on what?

4 lines on apple page? 20 lines man page? or brief description on Arstechnica (which could be more or less read as "Apple did it, so it is got to be cool")?

I would rather see D/BUS version of system wide launching mechanism. Unfortunatelly, that woulld mean that everything would have to support D/BUS, which would require a lot of rewriting.

D/BUS has very low requirements, it is running on *X and soon on Win too. What it would be nice it would be a possibility to access and work with D/BUS from low scripting level (bash, shell...). If you could register your script with system based D/BUS event?? That would be something.

Re:sweetness (-1, Flamebait)

Anonymous Coward | more than 9 years ago | (#12400089)

Your comment would have been less intolerable if you'd gone to the trouble of defining your pet buzzword.

Re:sweetness (1)

justsomebody (525308) | more than 9 years ago | (#12400138)

Pet buzzword?

Submitter is confused (3, Informative)

NewWazoo (2508) | more than 9 years ago | (#12399861)


Based on what I've read about it, it's more a replacement for xinetd and the sysv init scripts than cron.

B

From the apple page: (2, Informative)

ravenspear (756059) | more than 9 years ago | (#12399923)

Launchd provides faster startup through a unified framework for starting, stopping and managing daemons, and incorporates inetd, init, mach_init, System Starter and related services.

Re:From the apple page: (0)

matthew.thompson (44814) | more than 9 years ago | (#12399980)

So nothing like cron what-so-ever. Another great piece of Timothy's fact checking.

In fact that Ars-Technica article makes no mention of cron until half way through the page - so if it was actually read you'd have a good idea of what launchd does.

It seems to work quite well - my system has booted fully a number of times :)

Re:From the apple page: (5, Informative)

netsrek (76063) | more than 9 years ago | (#12400019)

So nothing like cron what-so-ever. Another great piece of Timothy's fact checking.

Before you jump the gun:
netstrek@computer: ~ $ cat /etc/crontab
# The periodic and atrun jobs have moved to launchd jobs
# See /System/Library/LaunchDaemons
#
# minute hour mday month wday who command

So yes, it is a cron replacement.

p0wned (-1, Troll)

Anonymous Coward | more than 9 years ago | (#12400159)

haha, fucker

Re:From the apple page: (0)

Anonymous Coward | more than 9 years ago | (#12400067)

So nothing like cron what-so-ever. Another great piece of Timothy's fact checking.

How about a little fact checking of your own? It can do anything cron can do.

Re:Submitter is confused (5, Informative)

As Seen On TV (857673) | more than 9 years ago | (#12399996)

The launchd service replaces (takes a deep breath) init, rc, the init.d and rc.d scripts, SystemStarter, inetd and xinetd, atd, crond, and watchdog.

Basically any task the needs to run on its own, rather than being manually started by a human being, can be handled by launchd.

Re:Submitter is confused (0)

n3m6 (101260) | more than 9 years ago | (#12400171)

so that does beat cron in lots of ways. However, the question is are we losing simplicity for features? Unix has always preferred simplicity - (does one thing and does it well) - over multiple features.

Submitter is NOT confused (4, Insightful)

jamezilla (609812) | more than 9 years ago | (#12400190)

From the launchd.plist man page [apple.com] :
A daemon or agent launched by launchd SHOULD:
oo Launch on demand given criteria specified in the XML property list.
What does cron do? Launch programs! Clearly this means that launchd can be used to replace cron.

Not only that but looking at the rest of the plist syntax reveals that this thing is waaay cooler than cron. It allows you to set user, group, chroot, check dependencies, designate where to send input and output, set resource limits and whole crapload of other things. Sure you can do this all from within a script, but this thing gives you all that for free.

die juden (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#12399865)

sind verboten!

Re:die juden (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#12399946)

nederlands or deutsch?

Re:die juden (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#12399965)

i answered my own question, you nazi piece of shit.

Flexibility (5, Funny)

Anonymous Coward | more than 9 years ago | (#12399867)

But can it be piped?

first post (-1, Offtopic)

Anonymous Coward | more than 9 years ago | (#12399871)

sounds intreasdfging

Probably not. (1, Insightful)

chuckfucter (703084) | more than 9 years ago | (#12399886)

Rather than have one system to rule them all, we will now have one more system to use, complain about, introduce new problems, and work with.

Re:Probably not. (1)

morcheeba (260908) | more than 9 years ago | (#12400105)

Did you even read the Ars Technica article?

For Tiger, Apple created launchd: one launch daemon to rule them all.

If you want to complain for the sake of complaining, go ahead. If you don't like to use multiple systems, what's your proposed solution -- use the first one that comes along and live with its limitations? Or, do you want to try something better that attempts to do exactly what you just asked for?

Not a cron replacement, a init replacement (5, Informative)

Anthony Liguori (820979) | more than 9 years ago | (#12399887)

Simply referring to launchd as a cron replacement is a major understatement. launchd runs as the init process and according to TFA was primarily made to replace the /etc/rc.d scripts during startup.

This is somewhat understandable for something like OS X. Doing something simple like displaying a GUI detailing startup is terribly difficult with /etc/rc.d scripts (considering the length of pause an fsck would take--users would certainly assume there system hung during boot).

I'm not sure launchd is something you'd want in 99% of Linux installs but if you're looking for a end-to-end user-oriented desktop I can see how a technology like this is necessary.

I'm not sure Apple Gets It though. Why in the world would they use XML configs? Gesh.

Re:Not a cron replacement, a init replacement (4, Insightful)

akac (571059) | more than 9 years ago | (#12399916)

Because everything in OS X uses XML configs. A dang site better than Windows Registry or the thousands of permutations that Linux uses.

Ahh yes. (0)

Anonymous Coward | more than 9 years ago | (#12399963)

OS X uses XML configs. A dang site better than Windows Registry or the thousands of permutations that Linux uses.

You're one of those; 'It's XML and therefore inherently better than ANYTHING else.', people eh? XML has its place but, is not the be all and end all of everything. Your kind seems to forget XML's place.

Re:Ahh yes. (2, Insightful)

cortana (588495) | more than 9 years ago | (#12400000)

More like, "it's a single, consistent format and therefore inherently better than anything else".

Re:Ahh yes. (2, Interesting)

KiloByte (825081) | more than 9 years ago | (#12400035)

In my opinion, XML is:
  • really wasteful
  • it takes a long time to parse
  • inconsistent (like, the sometimes-freeform-sometimes-not issue)
  • quite human-unreadable
Sure, it's better than .ini, but is it the best thing since sliced campers? No way.

Re:Ahh yes. (1)

nagora (177841) | more than 9 years ago | (#12400075)

Sure, it's better than .ini,

Is it?

TWW

Re:Ahh yes. (2, Informative)

KiloByte (825081) | more than 9 years ago | (#12400141)

.ini has the serious disadvantage of not allowing for more than two levels of properties.

But don't worry. I've once used a mmapped structure to make sure the config gets preserved over crashed -- but fortunately, someone beat me back into the senses. Try to exceed _this_ level of brain-damage :p

Re:Ahh yes. (0)

Anonymous Coward | more than 9 years ago | (#12400183)

quite human-unreadable

So? If you want readable make a java .properties file and then a conversion program to make that into the proper XML format.

I suspect that for non-trivial programs a simple .properties format file will not do. Its best to stick with XML so that everyone can read its agnostic format.

Re:Ahh yes. (2, Insightful)

Speare (84249) | more than 9 years ago | (#12400051)

Windows .ini files are consistent too, but you don't find fanboys harping that they're the best format since the parting of the red sea. The thing that both XML and .ini files lack is any self-documenting: you still need to know what options are supported and what values are useful for those options. XML for configs solves nothing new, and makes things more bloated by far. You move away from human readability/editability and into the realm where only a machine can fathom the format.

Re:Ahh yes. (0)

Anonymous Coward | more than 9 years ago | (#12400100)

Actually every XML bashing discussion here has at least one fanboy advocating for .ini or .properties style files.

(Just to throw my 2bits in: XML has the advantage of consistant whitespace and character encoding rules which always are a problem in flat ascii files.)

Re:Ahh yes. (1)

cortana (588495) | more than 9 years ago | (#12400115)

That's what a DTD is for.

And ini files are nowhere near good enough. Read "The Art of Unix programming" for a good description of the subtle ways in which ini sucks.

Plus the not-so-subtle ways: as soon as you want to make your config file format support repeating data (eg, >= 2 mail servers where you only had one before) you have to resort to ugly hacks like:

[servers]
server1.host = foo
server1.username = bar
server2.host = baz
server2.username = qux

or

[server1]
host = foo
username = bar
[server2]
host = baz
username = qux

Re:Ahh yes. (5, Insightful)

Cid Highwind (9258) | more than 9 years ago | (#12400123)

You move away from human readability/editability and into the realm where only a machine can fathom the format.

You're looking at this from the perspective of someone who understands and remembers the differences in a dozen config file formats. Most people don't.

Do comments in my .whateverrc start with a hash mark? A semicolon? A double slash? C-style /* ... */ delimiters? XML-style ? Are you even allowed to have comments? Can you use nested parentheses? Are angle brackets a symbol for redirecting i/o or do they delimit XML tags? Does a pipe chain the output of cone command to the input of another, or is it a logical or operator? Replacing that mess with a single standard format will make things *more* human readable IMHO, and it will certainly make it easier to have a single integrated pointy-clicky interface for changing all those configuration options.

Re:Ahh yes. (2, Informative)

mark_lybarger (199098) | more than 9 years ago | (#12400132)

if you want to document your xml config file format, you can give a schema (xsd) or dtd for your document. you can give all the information about al l the supported options for the config file in your schema definition.

xml is more robust than its property file counterpart.

Re:Ahh yes. (1, Funny)

Anonymous Coward | more than 9 years ago | (#12400210)

Yes!

If you provide an XSD Schema someone can easily load up the configuration file in an editor that knows how to provide xml completion for your xml config file if it knows what the schema is.

So if I type tag.

XML is a GREAT configuration format. Plus people say xml is hard to parse? What the heck!?!? It's the most parsable format out there with dozens of FAST parsers and tools for dealing with it. There could be nothing more open and less proprietary than XML.

Mod parent up. (0)

Anonymous Coward | more than 9 years ago | (#12400110)

[nt]

Re:Not a cron replacement, a init replacement (4, Insightful)

GamblerZG (866389) | more than 9 years ago | (#12400131)

For once I agree. XML is _ideal_ for configs. In fact, it is more suited for configs than for many other fields in which it's actively used. The key things are it's flexibility and human-editability.

Re:Not a cron replacement, a init replacement (5, Insightful)

Anonymous Coward | more than 9 years ago | (#12399935)

No, you don't get it. Why in hell would you want to write yet another config file parser and use your own awkward config format when you could use standard XML and that very same parser that's already loaded to system RAM as a shared lib?

Re:Not a cron replacement, a init replacement (1)

Anthony Liguori (820979) | more than 9 years ago | (#12400145)

No, you don't get it. Why in hell would you want to write yet another config file parser and use your own awkward config format when you could use standard XML and that very same parser that's already loaded to system RAM as a shared lib?

By it, I mean what the Unix community's needs are. I made this comment regarding the story's suggestion that other Unices may adopt this. Regardless of whether you think XML is the right solution, it seems obvious that the majority of the Unix community would probably not want XML to be used at such a fundamental part of their system's startup.

I don't think Apple's every considered, Hey, we should make this Open Source and incorporate requirements other Unices are probably going to have. They probably threw together something they needed and then decided to Open Source it. That's fine, they don't have to do anything other than that.

Re:Not a cron replacement, a init replacement (5, Insightful)

Senjutsu (614542) | more than 9 years ago | (#12399951)

I'm not sure Apple Gets It though. Why in the world would they use XML configs?

To make it easy to edit the files both by hand and via utilities which can be written very easily by leveraging existing XML parsing libraries?

Re:Not a cron replacement, a init replacement (3, Insightful)

JohnsonWax (195390) | more than 9 years ago | (#12400004)

Why in the world would they use XML configs? Gesh.

Well, machine parsable, heaps of validation tools to make sure you haven't shanked it, and user readable text so you can go in there and hack on it if you want.

Given that damn near every scripting tool out there has xml support, it seems like they've kept 90% of the admin-friendliness of unix config files and improved on system parsing by simply hanging off of a well proven structured document format, which standard config files most certainly lack.

Re:Not a cron replacement, a init replacement (3, Informative)

As Seen On TV (857673) | more than 9 years ago | (#12400018)

Because XML configuration files are self-validating.

The fundamental problem launchd was created to solve is system startup time. Twenty or thirty seconds to boot a freakin' laptop is just absurd. So we used launchd to get that down to four.

But beyond that, launchd also takes care of the problem of having six different types of configuration files, none of which are self-documenting or self-validating. A launchd configuration file can be validated and, if invalid (like somebody inserted a typographical error, or the file got truncated or something), discarded without interfering with system startup. That makes the system more resilient.

Re:Not a cron replacement, a init replacement (2, Insightful)

Anthony Liguori (820979) | more than 9 years ago | (#12400094)

The fundamental problem launchd was created to solve is system startup time. Twenty or thirty seconds to boot a freakin' laptop is just absurd. So we used launchd to get that down to four.

You can do parallel startup on most systems these days. Is there any reason why a daemon is necessary to improve startup time? Are shell scripts really that slow?

But beyond that, launchd also takes care of the problem of having six different types of configuration files, none of which are self-documenting or self-validating. A launchd configuration file can be validated and, if invalid (like somebody inserted a typographical error, or the file got truncated or something), discarded without interfering with system startup. That makes the system more resilient.

So it's fair to say that problems in shell scripts (that are based on syntax) are hard to isolate. I'll give you that. But why XML over say something like INI or a much simplier format?

XML is very heavy-weight (especially if you're validating it against a schema). It also quickly becomes unreadable. Startup scripts have always historically been hand-editable and hand-maintainable. While XML can be hand-edited, it's ugly and cumbersome.

I guess the typical Mac user won't care. XML configuration files are probably going to be the biggest thing keeping other Unices from picking launchd up.

Re:Not a cron replacement, a init replacement (0)

Anonymous Coward | more than 9 years ago | (#12400066)

I think that SYSV init and /etc/rc.d and all that is a fucked up system. People are so afraid to touch it, but its lack of modern features and the now-arcane inittab mean people do all sorts of ridiculous kludges to do things like e.g. dependent service startups and whatnot.

A replacement init is a great idea for the server and the desktop.... BUT.... here it comes.... WHY THE HELL HAS APPLE INVENTED YET ANOTHER NEW REPLACEMENT INIT? Note that RedHat are slowly doing the same thing, with SystemServices.

But Freshmeat is chock full of replacements for linux sysv init, like runit, daemond, daemontools, minit and others. I really doubt that either Apple or Redhat needed to write their own new one, it's just NIH in action.

Re:Not a cron replacement, a init replacement (1, Insightful)

Anonymous Coward | more than 9 years ago | (#12400106)

Well, for starters there's the fact that launchd is better than any of the "Look, mom, I wrote my own init!" packages out there.

You think it's "not invented here?" I think it's "not invented correctly."

Makes booting DAMN fast (5, Informative)

the_2nd_coming (444906) | more than 9 years ago | (#12399889)

the machine boots to a desktop (auto log in and all) in less than 15 seconds.

Wait, wait, wait... (0)

Anonymous Coward | more than 9 years ago | (#12400020)

Is the 15 second boot time a cold boot or is it a resume from hibernation?

Re:Wait, wait, wait... (4, Informative)

As Seen On TV (857673) | more than 9 years ago | (#12400077)

Actually, 15 seconds sounds really wrong to me.

To keep things simple, we divide the boot process into two halves: the hardware half and the software half. The hardware half involves power-on self-tests, and the time it takes varies wildly from computer type to computer type, or even from configuration to configuration. It takes longer to test 8 GB of RAM than 512 MB of RAM.

The software half begins with the grey Apple-logo screen turns blue and the progress window appears.

From the time that happens to the time the menu bar appears (via autologin) should be four seconds on a stock Mac OS X install with middle-of-the-road hardware (dual 1 GHz G4).

Re:Wait, wait, wait... (-1, Offtopic)

LittleLebowskiUrbanA (619114) | more than 9 years ago | (#12400164)

Poking around Tiger and so far I like it but nothing seems revolutionary except Spotlight. Is there a way to make Dashboard widgets sticky on the desktop? Amy I crazy to think battery life on my Powerbook is a bit better now with 10.4?

Re:Wait, wait, wait... (0)

Anonymous Coward | more than 9 years ago | (#12400194)

Hold F12 while dragging widgets from the widget bar onto the desktop, and they'll stay (until you activate dashboard again)

Re:Wait, wait, wait... (1)

rehannan (98364) | more than 9 years ago | (#12400181)

Macs don't have hibernation. They have sleep and that only takes a couple seconds to fully wake from.

Splitting hairs. (-1, Flamebait)

Anonymous Coward | more than 9 years ago | (#12400209)

Why don't you go and split the hairs around your anus. That is assuming that you have a single hair on your ass!

Re:Makes booting DAMN fast (1)

sammy baby (14909) | more than 9 years ago | (#12400048)

May I ask what your system specs are?

I doubt the boot time of my 867 TiBook will match that. ;)

Re:Makes booting DAMN fast (2, Interesting)

sjlumme (719239) | more than 9 years ago | (#12400205)

And that is exactly what Apple was missing in OS X. Old versions of Mac OS always booted pretty quickly, and their customers are used to that. I once had that discussion with a Windows user who complained Linux took so long to boot; the average user does not like to leave their computer on, for whatever reason.

Besides, what I'd be interested in is how this compares to Sun's SMF (System Managament Facility), which is also supposed to be a replacement for the SysV init system.

launchd does not replace cron (0, Insightful)

Anonymous Coward | more than 9 years ago | (#12399905)

If the submitter would have RTFA, he would know that launchd doesn't replace cron, but it replaces the sysv boot procedure (remember /etc/rc.d & friends) with something fancy. That might be a very good thing, since the current method is not really that flexible (for example, services are started one by one, you can't start them concurrently.).

Re:launchd does not replace cron (1)

eluusive (642298) | more than 9 years ago | (#12399972)

Gentoo has a nice system for init dependencies. However, they don't start independant services in parallel like they should..=/

Re:launchd does not replace cron (1)

mark_lybarger (199098) | more than 9 years ago | (#12400085)

that's because gentoo can't figure a good way to determine the dependancies between services so they throw their hands up and just say "parallel starting of services is bad".

i also like the way their portage system by default will upgrade an installed library and uninstall the previous version which has many binaries statically linked to it. the "solution" that keeps getting thrown around is to run some revdep-rebuild (which never seems to work for me). revdep-rebuild is suppose to find and rebuild the apps that portage broke.

Re:launchd does not replace cron (1)

McDutchie (151611) | more than 9 years ago | (#12399992)

Sure you can start them concurrently! Just add strategic "&" signs after the commands that start them up and they will start up in background processes of their own.

Re:launchd does not replace cron (0)

Anonymous Coward | more than 9 years ago | (#12400155)

You can start services concurrently: Append an ampersand to a command in the sysv init script, as in yadayada& I did this to greatly speed up the hotplug startup: hotplug (CPU-bound because of some stupid script) starts now in parallel with the other (IO-bound) daemons. Linux now needs 6 seconds less to boot. This does however look really ugly , as the boot messages mix up.

salutations (3, Funny)

sakura the mc (795726) | more than 9 years ago | (#12399914)

let me know when its in ports and ill try it out
freebsd gets no love around here

Re:salutations (1)

haskins_sam (653585) | more than 9 years ago | (#12400030)

Well, if Darwin is FreeBSD in your opinion, you could check it out now.

Against the UNIX philosophy (0)

Anonymous Coward | more than 9 years ago | (#12399917)

One tool, one job.

This replaces cron, init, and all sorts of things. Ugh.

Re:Against the UNIX philosophy (1, Insightful)

Anonymous Coward | more than 9 years ago | (#12400034)

The job: To automatically start services. The tool: launchd.

Does it make sense to have four different tools to start tasks at three different times? (Boot, login, network invocation, periodic.)

This sentence no verb? (5, Funny)

Anonymous Coward | more than 9 years ago | (#12399919)

I have nothing to contribute to this discussion, except for my opinion on how ambiguous headlines are. For example, "Does launched beat cron?" has the following possible meanings (yes, I see it's launchd, but listen):
1) Does as a verb, launchd as n, beat as v, cron as n. That is, a question whether or not the thing "launchd" beats the thing "cron".
2) Does as a verb, launched as adj, Beat as n, cron as v. That is, a question whether or not thing Beat, which has been launched, crons. (Well, "croon" is a verb, so maybe "cron" is too).
3) Does as a noun, launched as v, beat as adj, cron as n. That is, a statement that female deer have launched "Beat cron" -- cron that has been beaten, perhaps.
Any others?

Re:This sentence no verb? (2, Funny)

Anonymous Coward | more than 9 years ago | (#12400052)

You'll have a ball with the sentence "time flies like an arrow" then.

(Hint to get you started: Groucho Marx pointed out that "fruit flies like a banana")

Er, what? (0, Redundant)

James A. Y. Joyce (877365) | more than 9 years ago | (#12399920)

Launchd doesn't have anything to do with crond. You can even tell just by looking at the name! Launchd - system startup. Crond - periodic program running. Here was me thinking that the Slashdot editors were UNIX nerds. Turns out they're neither UNIX nerds nor editors. Jeez, check your submissions to make sure they're, ya know, factually correct.

Re:Er, what? (3, Informative)

mark_lybarger (199098) | more than 9 years ago | (#12399998)

did you RTFA? launchd seems to be a system wide super program launcher. startup, timed, event driven (plug in a usb memory stick and get a pop up window asking what you want to do).

from reading the article, launchd sounds like a viable technology to replace quite a few convoluted system on my linux machines.

Re:Er, what? (0)

Anonymous Coward | more than 9 years ago | (#12400151)

Uh did you read the grandparent post? HE SAID THAT.

What does that have to do with crond? NOTHING!

Is it really usable by the Open Source Community ? (0, Flamebait)

alexhs (877055) | more than 9 years ago | (#12399924)

<paranoia mode>
Can launchd be covered by some submarine patent ?

-- I'm not closing the paranoia mode publicly so YOUR heads will blow soon... --

Re:Is it really usable by the Open Source Communit (2, Informative)

antifoidulus (807088) | more than 9 years ago | (#12400107)

Uh, the code is licensed under the BSD model. So Apple will get in trouble as well if there is patent trouble.
I know making the statement, "boo patents!" on /. will get you modded up automatically, but come on people....

Apple is getting a bit stiff in their britches (0, Flamebait)

grikdog (697841) | more than 9 years ago | (#12399926)

Change Is Not Good, Leon. This sounds like another reason to delay adopting Tiger until the end of the fiscal year or later, since it seems unlikely that this is the last or only surprise the Man Who Created Lisa will drop on us.

my observation... (1)

bogaboga (793279) | more than 9 years ago | (#12399929)

...is that launchd might be better than cron. I'd like to have a system for example, start KMAIL and have this KMAIL send a customized message to my contacts depending on various metrics. As it stands now, achieving this is a bit geeky and I have no expertise to write the script to do it.

To make matters worse, current frontends to cron specifically require an executable. If this executable needs to have some input, matters become kind-of complex, at least for me.

If launchd can save me this misery, that would be a very good thing. The problem though is that I can hardly afford a Mac but I recognize that this is a nother matter altogether.

Re:my observation... (4, Interesting)

kaiser423 (828989) | more than 9 years ago | (#12399981)

yea, it really seems to clean up a lot of things. Like being able to tell that the service or process shutdown, instead of just sending bigger and badder kill messages.

Looks like a nice clean API that has some nice message passing structure in it. I also kind of like the magic dealing with auto-resolving dependencies and starting programs in parallel if possible.

From the sound of it, it just seems cleaner in the back-end. Much less knowing specific Unix tricks or gotchas, and more of it just working and giving you the proper interfaces.

idiot (1)

wobblie (191824) | more than 9 years ago | (#12400064)

WTF do you want to launch an interactive gui mail program in a script for?

Ever hear of the "mail" command?

Re:idiot (1)

bogaboga (793279) | more than 9 years ago | (#12400201)

> WTF do you want to launch an interactive gui mail program in a script for?

Because with Kmail for example, I could specify which domain to reply to. I do not know/see how I could change the "reply-to" email address if I use the mail command. Got it?

My observation, you are a clueless luser. (0)

Anonymous Coward | more than 9 years ago | (#12400148)

How can launchd save you this misery? Launchd is a service startup manager with limited scheduling capabilities. It will not make your desires for automating kmail any simpler. You will still have to have a program or script to perform the steps you desire with kmail. Using DCOP will be the best bet here. Scheduling the script with launchd won't be any easier than scheduling it with cron or AT.

Also check out Solaris SMF (5, Informative)

Wesley Felter (138342) | more than 9 years ago | (#12399931)

Sun came up with (at first glance) a similar thing called Service Management Facility [sun.com] in Solaris 10.

Meh. (0, Troll)

percussor (852680) | more than 9 years ago | (#12399934)

Looks like one more PITA for porters...

ugh (-1, Flamebait)

rsw (70577) | more than 9 years ago | (#12399947)

step 1: add XML to something that doesn't need it.
step 2: ?
step 3: profit.

-rsw

Re:ugh (1)

Swedentom (670978) | more than 9 years ago | (#12400053)

Doesn't need it? I'd say this is a quite good use of XML.

It's easily read and written by both humans (with only a text editor) and programs. I presume (but I haven't checked) that the XML is in plist format, which maps nicely to CoreFoundation/NS data types. This makes it even simpler for programs to read the format.

As long as it doesn't break the fundamentals... (5, Insightful)

yorick (4133) | more than 9 years ago | (#12399953)

Apple is doing a good thing here is shaking up the administrative and setup side of the UNIX world. Most of their work was actually NeXT's, but their "Application as directory" concept is wonderful in a lot of ways, and their reorganizing of the filesystem so that it makes more sense to users is probably a good move in the long run.

What makes UNIX superior for management and power-users is the ability to do everything you need to from command-line tools and options, and the fact that the storage for configuration is in understandable, alterable files. If those are still there...if I can still run my Apple from the shell--I'm a happy man.

The only exception to this would be cases where a vendor deliberately makes a deviation simply to introduce incompatibilities. I don't see that as the case here.

Did anyone else initially think (4, Funny)

Aexia (517457) | more than 9 years ago | (#12399989)

that the submitter simply couldn't spell or capitalise correctly?

"Does launchd Beat cron?"

What is that? Some new form of AOL speak?

Re:Did anyone else initially think (3, Informative)

One Childish N00b (780549) | more than 9 years ago | (#12400125)

While confusing, the styling of the article title is correct - it's just the combination of capitalisation as is normal for titles with the names of the commands all being in lower-case. UNIX commands are case-sensitive, thus there is no commad called 'Cron', only 'cron', and it's good journalistic form to spell names for things with correct case, even if (in this example) it does make things a little confusing/AOL-ish

Re:Did anyone else initially think (0)

Anonymous Coward | more than 9 years ago | (#12400127)

launchd and cron are both processes, and naturally uncapitalized.

So, no.

(me = original poster) yeah, bungled that up (1)

Blamemyparents (730461) | more than 9 years ago | (#12400185)

I think I was going for like a book title, where all imporant words are capitalized, but I think I was also trying to stick to the Unix style 'all program names are lowercase' thing (even though OS X, which this is all about, isn't case sensitive). It was all kinda subconcious. Ah well. =3

Less Compatible? (2, Interesting)

imemyself (757318) | more than 9 years ago | (#12400009)

Isn't half the attraction to OS X for geeks how its not that much different from Linux or BSD from the console? And that many/most Linux/BSD scripts and apps would work with just a few, if any changes? I don't see how making it more different really helps it. Not trying to be a troll, but I got to assume if all or most the other Unixes work with what launchd replaced just fine, that OS X could as well.

Re:Less Compatible? (5, Insightful)

revscat (35618) | more than 9 years ago | (#12400153)

Isn't half the attraction to OS X for geeks how its not that much different from Linux or BSD from the console?

I'm sure some do. But in the aggregate most users will balance something like this against the benefits gained. There are those who are also experimental enough who will try this, and if they find it to be a better implementation will then port it over to other *nix variants, leading to a new "standard".

rc.d, cron, etc. may be the way other unices do things right now, but that in and of itself is not justification enough to be married to such mechanisms in perpetuity. Sometimes it's beneficial to *cough* you know, "think different."

rc.d/ * replacement (0)

Anonymous Coward | more than 9 years ago | (#12400012)

It seems pretty well organized, but very osx specific. I wonder how much the directory structure, and the Agent vs Daemon thing can be reconfigured.

I really want to fiddle around with this one!

No thanks. (1, Troll)

Some Random Username (873177) | more than 9 years ago | (#12400032)

Adding XML to to core services like init is beyond stupid, and merging several independant utilities into one monolithic tool is the exact opposite of how unix works. A single, simple tool to do a single simple task. I can't imagine why any other unix system would want this thing.

I did RTFA, now tell me WTF it does (0)

winkydink (650484) | more than 9 years ago | (#12400059)

To paraphrase: It's an ambitious program that wants to handle all of your "launching" needs, including rc, cron & at. It's been open-sourced and the open source community would do well to look at it.

That's the article excerpt in a nutshell. It doesn't explain what it does or how it does it. In fact, it reads like it was copied from a press release.

Less sizzle and more steak please.

KHTML - Apple again (0)

Anonymous Coward | more than 9 years ago | (#12400074)

Only yesterday we had this article about the Apple's patchset not being really useful for KHTML and now this guy says

"Apple has returned the favor by contributing to many of those projects: FreeBSD, gcc, KHTML/KJS, etc."

Re:KHTML - Apple again (0, Troll)

justsomebody (525308) | more than 9 years ago | (#12400116)

Some people leave in their own dreams. Trouble is that you can't wake them up.

And yes, in their dreams Apple is the greatest contributor to OSS

Just like SMF (2, Interesting)

timf (21111) | more than 9 years ago | (#12400096)

Nice to see Apple take a page out of Sun's book [sun.com] ...

Re:Just like SMF (1)

timf (21111) | more than 9 years ago | (#12400149)

Replying to myself (how sad?) - the system restarter stuff sounds like the new process contracts stuff in Solaris. man ctrun [sun.com] on a Solaris 10 box.

alert (3, Funny)

fallendove (875598) | more than 9 years ago | (#12400104)

Seems like it's a bit nerdy,

Oh God, no! *exits window*

XML? (4, Insightful)

Anonymous Coward | more than 9 years ago | (#12400142)

We do need a replacement for our boot process. Boot GNU/Linux systems is slow. We want processes to be able to start concurrently, or in some cases, with specified pauses. If non-essentials (print server, etc.) start a few seconds after the log-in screen appears, I can be functional faster. We don't have a good system in place now.

We need a replacement. launchd isn't it. The problem, fundamentally, is XML. XML is a problem since, fundamentally, it is very flexible formatting, and so doesn't play nice with shell scripts. You can't easily cut/sed/etc. xml files. Until we get a suite of replacement tools that can easily modify XML files from shell scripts, XML won't cut it.

One of the key things to a good system is to make easy, common things fast and easy. The minimal overhead for any program that modifies an XML file is way, way, way to large to want to use it as the standard system format.

Well it might not be better than cron... (1)

NoMercy (105420) | more than 9 years ago | (#12400167)

But it's more than cron, it "incorporates inetd, init, mach_init, System Starter and related services" according to apple... I'm not sure I'm that happy with it including everything but it's features sound damn impressive, and I do hope we see something like this for Linux/et-all.

SYSV.. bah. BSD-style is the way to go. (4, Informative)

rice_burners_suck (243660) | more than 9 years ago | (#12400168)

I thought this was a replacement for the big messy SYSV-style init scripts.

Speaking of which, back in about 1995, I think it was, I installed my first Linux distro that I actually used on a daily basis. It was an early version of SuSE linux. Anyway, as I scratched deeper and deeper under the surface, I came to the conclusion that the init system was a mess... the entire system's functionality was implemented as piles upon piles of shell scripts, organized neatly into a whole bunch of directories, and activated according to their name and whatnot. This seemed kind of dumb, actually, because it meant that startup, shutdown, and switching runmodes were a lot less efficient than necessary, and also because you'd have to search through a zillion (that's a big number) scripts to find what you need.

A few years later, in 1999 or so, I tried FreeBSD for the first time. (Here it comes, I'm gonna be modded troll for starting another BSD- vs. SYSV-style init script war...) There, the functionality is still implemented in scripts, but there was a much more sane system. There is one script that is the same across all FreeBSD installs of that version. Then, there's the script you get to customize if you want. There's one more file, and that's where you simply give yes or no answers, or provide other data, in the form of environment variables that influence the running of those two scripts. It's so simple, and works quite quickly. Also, since you really only mess with one file, and two if you modify the script, it's much easier to find where things are. It's more efficient, from many standpoints.

So I don't blame Apple for getting rid of that SYSV stuff. It might have been cool back in the day, but it has lost its luster.

You see? (-1, Troll)

Anonymous Coward | more than 9 years ago | (#12400182)

You see that?!? Look at that...this shows
that APPLE, and not Microsoft, Sun, sgi, SCO, etc. are the TRUE innovators!

Apple's doing more to make UNIX usable and user-friendly than all the previous unices and unix
companies combined. They're certainly doing a lot more than the Linux crowd.

Right now, you'd have to consider Mac OS X (Tiger, and even previous versions) - as the BEST implementation of UNIX ever made! And they were late to the party!

Just like they did with the personal computer, and
portable mp3 players, and online music stores, and publishing and content creation utilities - Apple, and only Apple - took something that was CRAP and made it cool and useful - integrating and going several steps beyond what was previously available or even possible.

Not a CRON replacement! (-1, Redundant)

Anonymous Coward | more than 9 years ago | (#12400184)

This "launchd" util is not a replacement for cron, it doesn't even perform the same tasks as cron. It seems to me that launchd is more like an hybrid replacement for inetd and the good old way of starting services at boot time using initd scripts.

Looks a bit like DJB's daemontools actually. (nasty)

*sigh* (5, Informative)

cbiffle (211614) | more than 9 years ago | (#12400199)

This thread, so far, seems to be filled mostly with "Ah! Someone's doing something differently than UNIX has for 30 years! My knee is jerking!" So I feel I should respond.

launchd is neat. It's not simply a different way of doing the same things, it lets you do different things.

Like automatically evaluating dependencies between daemons, starting them in the right order, and running them in parallel if needed. FreeBSD's the only other OSS system I've ever seen do this; Gentoo does the dependencies but not the parallel startup. (Which is annoying while it's, say, trying to get an address from a nonexistent DHCP server.) Long story short, it dramatically reduces boot time, while eliminating dependency hacks like runlevels and numbered scripts. (Not that BSD had them.)

For those of you who posted without reading the manpage (or administering an OSX system), it also lets you do init-style startup tasks on a per-user basis. You can configure it to start daemons and other processes on the behalf of users as the log in, and shut them down -- gracefully, not by TERM; KILL -- when the user logs out.

Anyone who's ever dealt with the myriad of hacks to get ssh-agent in place will understand why this is good.

There's a lot of resentment these days toward anyone who does something that's perceived as "not the UNIX way." Change is the only way to innovation, people; perhaps the UNIX way is broader than you thought?
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>