Signs of Triviality

Opinions, mostly my own, on the importance of being and other things.
[homepage] [index] [] [@jschauma] [RSS]

Mac OS X: amanda vs. launchd

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:          dgram   udp     wait    backup
/Volumes/pkgsrc/pkg/libexec/amandad amandad  

This can easily be converted into an xinetd(8) file:

service amanda {
	socket_type	= dgram
	protocol	= udp
	wait		= yes
	user		= backup
	group		= operator
	groups		= yes
	server		= /Volumes/pkgsrc/pkg/libexec/amandad
	bind		=
	only_from	=

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 /System/Library/LaunchDaemons/amanda.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"

<plist version="1.0">


	<string>Amanda Backup Daemon</string>








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 startamanda:

/bin/launchctl unload /System/Library/LaunchDaemons/amanda.plist
/bin/launchctl load /System/Library/LaunchDaemons/amanda.plist
and add the following entry to root's crontab:
@reboot /var/root/bin/startamanda
This actually seems to work, even though it ain't pretty.

March 16, 2006

[Mac OS X NFS share vs. Garritan Personal Orchestra] [index] [Solaris 10 serial console]