Saturday, October 24, 2015

Oh Cry Me a River, Steve

[Note: Steve Litt wrote a post that appeared in one of the book publishing chat boards. The discussion was about Apple's launchd program vs. what Linux uses to start up and schedule programs to run. No, this is not really about launchd... it is about how the Linux community is the Republican Party of the computer world. He writes:]

Process Identifier 1 (PID1) [in Apple's OS X] contains an entire XML
parser. Who knows, maybe next version the Ghost Of Jobs will add a
marching band to PID1.

Oh cry me a river, Steve.

Jeez, Louise. That’s the best you got?

Well, it’s not enough, not hardly.

PID1 is the launchd program which is far and away a huge, huge, huge improvement over the (Linux/Unix) antiquated cron (which Apple still has but does not use) as well as the arcane init system.

Cron is the utility that can be configured (if you know 'voodoo') to schedule and start programs.

From a user standpoint launchd is the cron replacement utility Apple uses to start (and stop) various programs that it needs to run at various times and it is user configurable as well (like cron.)

You can 'program' launchd to run your 'jobs'... such as nightly backups or uploads to your server, etc.

Of course you need 'scripts' that actually do the work, but there are lots of these on the net you can get and then configure launchd to run them when you want. We have a bunch of scripts that upload files to our server as well as download a few as well. For example, one of them takes the Apple Contacts, converts it to a text file and uploads it to our server as a backup... each night.

The launchd daemon essentially replaces the old Unix/Linux:
  • init
  • rc
  • init.d script
  • rc.d script
  • SystemStarter (OS X)
  • inetd / xinetd
  • crond / atd
  • watchdogd

Since the dawn of time no one but unbathed, sugar inebriated geeks could figure out how to use the cron utility as well as all of the other arcane geek-ninja-only 'init' group of systems.

Cron and its partner programs are some of the most complex black-arts of Unix/Linux, the secrets of which are only handed down from master-geek to grasshopper-geek in Linux User Group (LUG) meetings held in Pizza Hut restaurants serving bad pizza and over-caffeinated cola.

There are lots of articles on launchd vs. the antiquated array of obtuse Linux utilities you can read here.

Apple created launchd and even put it in the public domain thinking that the Linux folks would have the required brain cells to adopt it. Of course, the Linux community which years ago (as often today) were/are basically the Luddites of the computer world (sounds like a contradiction in terms, but not if you know the Linux mindset imbued with antipathy against anything new and better) refused to adopt it.

Big surprise!

A little history, courtesy of Wikipedia:

A port to FreeBSD was done as part of Google Summer of Code Project in 2005.

The Ubuntu Linux distribution considered using launchd in 2006. launchd was rejected as an option because it was released under the Apple Public Source License.

In August 2006, Apple relicensed launchd under the Apache License, Version 2.0 in an effort to make adoption by other open source developers easier.

It took  the Linux community, which hates all things Apple and Microsoft, a long time to 'get it' that launchd was a better system. But when they did, they instead decided to write their own version of launchd which is called systemd… and ever since the release of it, there has been a holy war waged in the Linux community over its use… and those flavors of Linux which have adopted it (which are most of the more popular distributions,) are shunned by the high-priests of Linux...  the Druids and troglodytes of the computer ‘world.’

They kept cron intact (like Apple did) but added systemd/timers as a replacement (it's not a bad system, but not quite as flexible as launchd, IMO.)

Launchd is based on XML, which adds a layer of complexity to it, but at the same time exposes many layers of flexibility.

Years ago I wrote a well-received and popular tutorial on launchd called: Apple Mac OS X launchd For The Complete Idiot.

Since that article was published several easy-to-use front-end utilities have been written… the best of which is called Lingon which makes it slam-dunk easy to schedule any program or script that you might want to run.

Yes, we can use the old cron, but Apple has deprecated it which is their way of saying “One day we may drop it, so use the new ‘stuff’ instead.” And the Apple community, being the Jefferson and de Vinci personas of the computer world, have adopted it and are happy with it, for the most part (yeah, there are a few Luddites in the Apple world as well, but they are more a curiosity than a majority.)

I have great respect for Steve Litt, his writing ability, his tech knowledge and the content of his many technical books (even though his web site looks like it was done in 1997!) But at times he is the Ted Cruz, the Huckabee, and the Heritage Foundation of the tech community all rolled into one… and there are many like him who start their LUG meetings with cold pizza and Jolt cola singing that old arch-conservative Linux ‘spiritual:’

Old stuff is good
New stuff is crud
Let’s all beat our feet
On the Mississippi mud

One day, a leader will rise up in the Linux community and say “I have a dream!”

I doubt it will be in my lifetime.

I like and respect most Linux people... and I run Linux on some of my older hardware. I like to kid Linux people about their hoodies and Jolt cola, just as they rib me about my Apple 'uniform'... NorthFace jackets and black "Steve Jobs" mock-turtles.

But for the life of me I'll never comprehend the amount of anger that some members of the Linux community hold for anyone who dares differ with them... sort of like those in the Republican Party.