Appleosity

Jan. 4th, 2008 01:57 pm
serinde: (Default)
[personal profile] serinde
I have been steadily turning to the Candy-Colored Side since the beginning of my employ. (Including spending most of today frobbing new machines, including the 24" iWhack I was not actually supposed to get, whoopsie!.) Earlier this week I made the final test: I had Boot Camp put a Windows partition on the laptop, booted into it, installed CoH, and tried it out. Seems to work fine, modulo the annoyance of trying to play with a trackpad. (Ah. Mem.: try TeamSpeak.)

So the kool-aid is delicious and fruity, and it seems likely that the next time we need to upgrade something (which is probably soon), I will be switching to a Mac. Jury is still out between iMac and a Mac Pro. Obviously the Mac Pro would be much sweeter, but iMacs are considerably cheaper, and if they are butch enough to do what I need, I may restrain my greed as it is likely to be a generally expensive year.

Date: 2008-01-04 11:56 pm (UTC)
From: [identity profile] fivetonsflax.livejournal.com
Oh, and if you figure out what the deal is with rc.local, let me know. In the mean time, Mac OS X's crontab(5) does support "@reboot", according to the man page.

Date: 2008-01-05 02:18 am (UTC)
From: [identity profile] spride.livejournal.com
Cron and crontab haven't been the right way to launch processes since 10.4.0 - launchd is the thing to use.

As long as people persist in treating Mac OS X as BSD or Linux and then getting annoyed when it isn't exactly the same, they're going to complain.

Date: 2008-01-05 03:13 am (UTC)
From: [identity profile] fivetonsflax.livejournal.com
I'm not complaining. Cron is there, and it works. I mentioned upthread that Mac OS X is UNIX<tm>, and I meant it. One of the cool things about UNIX and its clones is that one does not need to use completely different methods with every variant.

I have dabbled with launchd, but found it difficult to work with. I admire its versatility, but it is perhaps a bit heavyweight for simple things like this.

But, since you are offering solutions — how would you launch a job on reboot with launchd? How would you get a list of such configured jobs?

Date: 2008-01-05 03:26 am (UTC)
From: [identity profile] spride.livejournal.com
Preamble: Peter Borg has written Lingon, a wonderful tool for managing Launchd property lists [1], over at

http://lingon.sourceforge.net/

And I'd use that to launch my process by setting "Run it when it is loaded by the system (at startup or login)".

Lingon will also show you all user and system agents and daemons managed by launchd.

The command line alternative is launchctl - a one-line or interactive interface to launchd.

MacBookPro:~ spride$ launchctl list
PID	Status	Label
460	-	0x10d770.launchctl
450	-	0x10d670.bash
449	-	0x10c300.login
448	-	[0x0-0x35035].com.apple.Terminal
…


between launchctl and Lingon I think that'd stand you in good stead.

[1] launchd uses simply-formed XML files as its control files, which normally live in:
~/Library/LaunchAgents         Per-user agents provided by the user.
/Library/LaunchAgents          Per-user agents provided by the administrator.
/Library/LaunchDaemons         System wide daemons provided by the administrator.
/System/Library/LaunchAgents   Mac OS X Per-user agents.
/System/Library/LaunchDaemons  Mac OS X System wide daemons.

Date: 2008-01-05 05:21 am (UTC)
From: [identity profile] fivetonsflax.livejournal.com
Call me crusty, but I *do* find that a bit heavyweight. I don't think I should need any tool besides vi to set up a job to run at startup. Mac OS X does supply cron and I won't apologize for using it.

Date: 2008-01-05 02:57 pm (UTC)
From: [identity profile] spride.livejournal.com
Well, it's intended as a superset of process initiation tools such as init, rc, the init.d and rc.d scripts, SystemStarter (Mac OS X), inetd and xinetd, atd, crond and watchdogd, so it has to be more flexible, and I guess that results in a little more complexity. I don't think it's unreasonably complex given what it does. But whatever works, works. :-)

Date: 2008-01-07 01:06 am (UTC)
From: [identity profile] sweh.livejournal.com
It, like SOlaris 10 svcs (a SQL based config) allows a much more flexible configuration with dependencies, service recovery, auto-restart and monitoring... all good stuff.

I don't object to the new way of doing things, but I do object to them leaving hooks for the old way which don't work (there is an /etc/rc and it does reference /etc/rc.local, so why doesn't the script run?). Heh, I notice that hook has disappeared in 10.5.1. Heheheh

Date: 2008-01-07 01:09 am (UTC)
From: [identity profile] spride.livejournal.com
I can find out, if you like? We have Apple Lackeys at our beck, and even call on occasion.

Date: 2008-01-07 01:24 am (UTC)
From: [identity profile] sweh.livejournal.com
Given the hook disappearing, it was probably left over cruft that hadn't been properly cleaned up in the migration to launchd and so a red herring. If I cared enough then I could work it out for myself (strategic echo statements spread throughout the boot scripts are wonderful debugging tools :-)). But it's not a big issue. I just have a sudo script called from my login profile, and my account is set to auto login so I have an effective work-around.

Date: 2008-01-07 01:02 am (UTC)
From: [identity profile] sweh.livejournal.com
Don't play with Solaris 10 then. The boot process of that is managed by SQL configuration files, the contents which are initialised from XML templates and then managed by command line options. Even inetd.conf doesn't actually do anything, anymore.

Date: 2008-01-07 01:05 am (UTC)

Date: 2008-01-07 01:08 am (UTC)
From: [identity profile] sweh.livejournal.com
10.5.1 doesn't seem to have the rc.local hook any more (at least "grep -r rc.local /etc" doesn't find anything) so maybe it was just uncleaned crufy in 10.4.10

Profile

serinde: (Default)
serinde

December 2024

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 19th, 2026 02:33 am
Powered by Dreamwidth Studios