starting services at boot time on Darwin

I needed to get snmpd to start up at boot time on a Darwin box, so I had to delve into Apple’s way of handling rc/init scripts.

All the stuff lives in /System/Library/StartupItems with a directory for each service.
[/System/Library/StartupItems]:: ls -F
Accounting/ Cleanup/ IPServices/ SSH/
Apache/ ConfigServer/ NFS/ SecurityServer/
AppServices/ CrashReporter/ Network/ Sendmail/
AppleShare/ Cron/ NetworkTime/ SystemLog/
AppleTalk/ DirectoryServices/ Portmap/ SystemTuning/
AuthServer/ Disks/ SNMP/

So I copied the SSH directory and made some changes to its contents (three files, all contained in the linked archive below).

SNMP.tgz

[/System/Library/StartupItems]:: ls -FR SNMP
Resources/ SNMP* StartupParameters.plist

SNMP/Resources:
English.lproj/

SNMP/Resources/English.lproj:
Localizable.strings

As you can see, SNMP is the executable script, Resources is a directory with another inside it, and the other is a text file. The text files just need to be modified to reflect what they’re associated with (in this case, the snmp daemon).

You then add a line to /etc/hostconfig that the startup script will look for:

SNMP=-YES-

This was patterned after the existing startup stuff.

I have tested it and it works just fine. I’m glad it was that easy. You can see the results here.

There are some more, um, informed docs on this here.

<addendum, June 7 >

Well, I may have oversimplified this: it seems there is more than one place for StartupItems, and I of course chose the wrong one.

Creed Erickson of Apple’s Software Engineering Operations team sent this to the open-darwin discussion list:

Locally supplied startup items–as opposed to Apple supplied items–should be in /Library/StartupItems rather than in /System/Library/StartupItems.

However, it’s not clear how to handle that on a pure Darwin system, ie w/o Aqua and therefore not OS X: there is no /Library/StartupItems. Am I supposed to create it?

3 cheers for patients’ rights

The Seattle Times: Local News: Clinic charging drug-firm reps: Polyclinic demands $30 an hour before it will hear sales pitch

A local physician-owned medical practice has decided to charge all drug sales reps for the time they keep doctors away from their patients: if the Polyclinic wasn’t already our pediatrician, I’d be finding some way to get on their list.

The “pay per view” policy, which went into effect Monday, will levy fees ranging from $30 for one hour’s access to the clinic to $200 for eight hours.

$30 an hour seems cheap: I would have made it $100 and $1000 for the full day.

I have always been amazed at the number of immaculately groomed and dressed drug salespeople I would see in the halls and elevators, pressing their free samples, fighting for shelf space. I know medicine is a for profit industry but I shouldn’t have to feel like I’m competing with salespeople for my physician’s attention.

I especially like the veiled threat that doctors who limit access to salespeople will lose out on valuable treatment options: isn’t that what journals are for? Are we supposed to think a board-certified physician is going to take the advice of generic sales person on matters of patient care and pharmacology?

Most of the comments missed the point: this isn’t about an additional revenue stream for doctors, but a nuisance tax, charging back the expense for the time diverted from patient care to those drug companies who are willing to pay for it. The doctors may use the money to fund indigent care or subsidize medical school scholarships, for all we know: what matters is that those who want access to a scarce resource should have to pay for it, just as patients have to.

educational software that might actually work

KDE educational tools

I’m actually opposed to computers in schools: I think it’s silly to think a computer is going to teach anything better than an actual teacher can. Consider that the people who invented the computer didn’t have access to one, nor did the writers of most the great works of literature, etc. They’re just tools, after all.

Anyway, I upgraded my desktop to KDE3 today and discovered the kedu package, a couple of useful educational things. One to learn touch-typing (I’ve needed that for years), and one to allow simple tests to be composed as a drilling aid. It takes the questions and answers through simple form-based UI, and creates little XML docs that can be read in as tests. See an example below:
Continue reading “educational software that might actually work”

browser tabs vs new browser windows

Anyone know how to make these new tabbed browsers (Galeon, Mozilla, Chimera/Navigator) open a new tab rather than a new window when “TARGET=_new” is called? Hmm, well, to answer my own question, it’s in Mozilla 1.0’s prefs, but if you hold the Ctrl key when you click, you open a new tab instead of loading a new page into the existing window.

Hmm, well, to answer my own question, there’s something close to this in Mozilla 1.0’s prefs, but if you hold the Ctrl key when you click, you open a new tab instead of loading a new page into the existing window. The behavior I would like to load pages in the existing window but create tabs for all new windows.

new invention requested

I want a device that answers the phone and if it hears either a lengthy pause or the muffled hubbub of a telemarketing boilerroom, it quietly hangs up and blocks the number from ever ringing again.

Yes, I have caller ID, but not all callers are ID’ed. And I have an answering machine but every call I let it answer is one I would have liked to pick up.