In order to backup our Mac OS X server to our central backup host and tape library, we installed amanda via pkgsrc. Since pkgsrc needs a case-sensitive filesystem, it lives and installs into a separate volume from the root volume. That is, we have / and /Volumes/pkgsrc, with the amanda daemon installed in /Volumes/pkgsrc/pkg/libexec/amandad. The backup server is set to use tar(1) on this host, since apparently dump(8) does not actually work on OS X (resource forks?). (Note that tar(1) only supports resource forks on OS X since Tiger.) So far, so good.
Now we need to get the amanda daemon to start at boot time
automatically. On all other hosts, this is done via inetd:
This can easily be converted into an xinetd(8) file:
So far, so good. Starting this manually by kill -HUPing
xinetd works fine. However, after rebooting the machine, it no longer
works. If I log in and restart xinetd manually, it works. Alright, so I
think I'll go the way that Apple really wants me to anyway, and convert
this to launchd(8). I create the following
I launchctl load /Library/LaunchDaemons/amanda.plist. I see it's listed via launchctl list. I see it's listening via netstat(1). I think I'm golden.
I reboot, and launchd did not start amanda. launchctl list does show it, though. If I launchctl unload it and then launchctl load it again, everything's working.
So after toying around with this for a while, I realize that the problem is that executable (/Volumes/pkgsrc/pkg/libexec/amandad) is located on a different volume than the root volume. And apparently there is no way to tell launchd(8) to mount certain filesystems first the way one might do it using critical_filesystems_local under NetBSD.
So... to get around this, I created a short script called
March 16, 2006