/Installation/OS Specific Notes/Installing Amanda on Mac OS X: Difference between revisions

From wiki.zmanda.com
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
''Work in Progress'' --[[User:Dustin|Dustin]] 13:31, 8 March 2007 (PST)
Amanda has been tested to run on both Mac OS X Panther (10.3) and Tiger (10.4).
Amanda has been tested to run on both Mac OS X Panther (10.3) and Tiger (10.4).


With Panther, the built-in <tt>tar</tt> does not record extended filesystem attributes (resource forks, finder flags, ACLs, and so on), so users who want to be able to restore those attributes will need to do some extra work (see below).  Fortunately, Tiger's <tt>tar</tt> does support extended attributes, so an amanda installation will work "out of the box".
With Panther, the built-in <tt>tar</tt> does not record extended filesystem attributes (resource forks, finder flags, ACLs, and so on), so users who want to be able to restore those attributes will need to do some extra work (see below).  Fortunately, Tiger's <tt>tar</tt> does support extended attributes, so an amanda installation will work "out of the box".


This page is summarized from writeups by [https://webserver.brandeis.edu/pages/view/Bio/AmandaMacOSXCompileNotes Steven Karel] and [http://www.locnar.net/drupal/?q=node/16 Locnar] and [[User:Dustin|Dustin]]'s work on Amanda.
This page is summarized from writeups by [https://webserver.brandeis.edu/pages/view/Bio/AmandaMacOSXCompileNotes Steven Karel] and [[User:Dustin|Dustin]]'s work on Amanda.


= General Setup =
= General Setup =
== Set Up 'amanda' User ==
== Set Up 'amandabackup' User ==
The following steps use 'niutil' to set up Amanda in the netinfo database, and then creae a home directory for the new user.
The following steps use 'niutil' to set up Amanda in the netinfo database, and then creae a home directory for the new user.
  sudo niutil -create / /users/amanda
  sudo niutil -create / /users/amandabackup
  sudo niutil -createprop / /users/amanda shell /bin/bash
  sudo niutil -createprop / /users/amandabackup shell /bin/bash
  sudo niutil -createprop / /users/amanda realname "Backup User"
  sudo niutil -createprop / /users/amandabackup realname "Backup User"
  sudo niutil -createprop / /users/amanda uid 5000
  sudo niutil -createprop / /users/amandabackup uid 5000
  sudo niutil -createprop / /users/amanda gid 0
  sudo niutil -createprop / /users/amandabackup gid 0
  sudo niutil -createprop / /users/amanda home /Users/amanda
  sudo niutil -createprop / /users/amandabackup home /Users/amandabackup
  sudo ditto -rsrcFork '/System/Library/User Template/English.lproj/' /Users/amanda
  sudo ditto -rsrcFork '/System/Library/User Template/English.lproj/' /Users/amandabackup
  sudo sh -c "echo 'amanda_server.domain.com amanda' > /Users/amanda/.amandahosts"
  sudo sh -c "echo 'amanda_server.domain.com amandabackup' > /Users/amandabackup/.amandahosts"
  sudo chown -R amanda:wheel /Users/amanda
  sudo chown -R amandabackup:wheel /Users/amandabackup
  sudo passwd amanda
  sudo passwd amandabackup
Replace <tt>amanda_server.domain.com</tt> in the above with the name of your amanda server.  This file is used as a basic security check to control which hosts can access <tt>amandad</tt> on this client.
Replace <tt>amanda_server.domain.com</tt> in the above with the name of your amanda server.  This file is used as a basic security check to control which hosts can access <tt>amandad</tt> on this client.


Line 34: Line 32:
  sudo touch /etc/amandates
  sudo touch /etc/amandates
  sudo chmod 660 /etc/amandates
  sudo chmod 660 /etc/amandates
  sudo chown -R amanda.wheel /etc/amandates
  sudo chown -R amandabackup.wheel /etc/amandates


And set up some directories where Amanda can store small bits of data:
And set up some directories where Amanda can store small bits of data:
  # TODO: get paths right for no --prefix
  # TODO: get paths right for no --prefix
  sudo mkdir -p /var/amanda
  sudo mkdir -p /usr/local/lib/amanda
sudo mkdir -p /usr/lib/amanda
  sudo touch /usr/local/lib/amanda/exclude.gtar
  sudo touch /usr/lib/amanda/exclude.gtar
  sudo mkdir -p /usr/local/var/amanda/gnutar-lists/
  sudo mkdir /var/amanda/gnutar-lists
  sudo chown -R amandabackup:wheel /usr/local/lib/amanda /usr/local/var/amanda/
  sudo chown -R amanda:wheel /usr/lib/amanda /var/amanda


= Compile Amanda =
= Compile Amanda =
Download and untar Amanda, then run <tt>./configure</tt> as follows:
Download and untar Amanda, then run <tt>./configure</tt> as follows:
  ./configure --with-user=amanda --with-group=wheel  
  ./configure --with-user=amandabackup --with-group=wheel  
You will want to examine <tt>./configure --help</tt> first to see what other options are available.  For example:
You will want to examine <tt>./configure --help</tt> first to see what other options are available.  For example:
; <tt>--without-server</tt>: just build the client components
; <tt>--without-server</tt>: just build the client components
; <tt>--prefix</tt>: install somewhere other than <tt>/usr/{bin,sbin,lib}</tt>, etc.
; <tt>--prefix</tt>: install somewhere other than <tt>/usr/local</tt>, etc.
; <tt>--with-config</tt>: set the default configuration
; <tt>--with-config</tt>: set the default configuration
; <tt>--with-gnutar</tt>: give the path to GNU tar (especially useful on Panther; see below)
; <tt>--with-gnutar</tt>: give the path to GNU tar (especially useful on Panther; see below)
; <tt>--without-xsltproc</tt>: don't build the manpages from XML (the XML parser is flaky)
; <tt>--without-xsltproc</tt>: don't build the manpages from XML (the XML parser is flaky)
Then follow the usual
 
  make; make install
This tutorial assumes that <tt>--prefix</tt> is left at the default, which installs everything (including configuration and state) under <tt>/usr/local</tt>.  This helps to segregate amanda's information from files managed by Apple, and is probably best for end-user machines.  If you will be actively working with the amanda configuration on these machines, you may want to consider:
; <tt>--sysconfdir=/private/etc</tt>: store configuration in the usual place under <tt>/etc/amanda</tt> and <tt>/etc/amandates</tt>.
; <tt>--localstatedir=/private/var</tt>: store state in the usual place under <tt>/var/amanda</tt>.
If you make these changes, you'll need to adjust the directories created in above.
 
To compile and install, follow the usual
  make
sudo make install


= Version-Specific Notes =
= Version-Specific Notes =
== Tiger ==
== Tiger ==
The above instructions should work without modification for Tiger.
To get <tt>amandad</tt> to run when packets from the server arrive, you'll need a launchd script.  See [http://developer.apple.com/macosx/launchd.html Apple's Getting started with launchd] for background on this system.
 
Steven Karel has supplied a handy property list [https://webserver.brandeis.edu/pub/Bio/AmandaMacOSXCompileNotes/org.amanda.amandad.plist here], on which this version is based.  You'll need to edit these slightly to give the correct path to amandad.  The first runs amandad with BSDTCP authentication; the second uses BSDUDP authentication.  These files will be available in <tt>contrib/macosx/resources</tt> in an upcoming release.
 
<pre><nowiki>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.amanda.amandad.bsdtcp</string>
<key>UserName</key>
<string>amandabackup</string>
<key>GroupName</key>
<string>wheel</string>
<key>InitGroups</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/libexec/amandad</string>
<string>-auth=bsdtcp</string>
</array>
<key>Sockets</key>
<dict>
<key>ipv4</key>
<dict>
<key>SockFamily</key>
<string>IPv4</string>
<key>SockServiceName</key>
<string>amanda</string>
<key>SockType</key>
<string>stream</string>
</dict>
<key>ipv6</key>
<dict>
<key>SockFamily</key>
<string>IPv6</string>
<key>SockServiceName</key>
<string>amanda</string>
<key>SockType</key>
<string>stream</string>
</dict>
</dict>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
</dict>
</plist>
</nowiki></pre>
<pre><nowiki>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GroupName</key>
<string>wheel</string>
<key>InitGroups</key>
<true/>
<key>Label</key>
<string>org.amanda.amandad.bsdudp</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/libexec/amandad</string>
<string>-auth=bsdudp</string>
</array>
<key>Sockets</key>
<dict>
<key>ipv4</key>
<dict>
<key>SockFamily</key>
<string>IPv4</string>
<key>SockServiceName</key>
<string>amanda</string>
<key>SockType</key>
<string>dgram</string>
</dict>
<key>ipv6</key>
<dict>
<key>SockFamily</key>
<string>IPv6</string>
<key>SockServiceName</key>
<string>amanda</string>
<key>SockType</key>
<string>dgram</string>
</dict>
</dict>
<key>UserName</key>
<string>amandabackup</string>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<true/>
</dict>
</dict>
</plist>
</nowiki></pre>
 
Copy one or both of the property lists to <tt>/Library/LaunchDaemons</tt>, and load them with
sudo launchctl load -w /Library/LaunchDaemons/org.amanda.amandad.bsdudp.plist
You should see the following output from netstat:
me@mac ~ $ netstat -na | grep 10080
udp6      0      0  *.10080                *.*
udp4      0      0  *.10080                *.*
(or tcp6/4 for BSDTCP).


== Panther ==
== Panther ==
A user reports that for some versions of Mac OS X you may need to increase the UDP packetsize, as explained in [[Amdump:_results_missing#UDP_packet_too_large.3F|UDP packet too large]].


To support extended attributes on Panther,  
To support extended attributes on Panther,  
Line 73: Line 184:
         protocol                = udp
         protocol                = udp
         wait                    = yes
         wait                    = yes
         user                    = amanda
         user                    = amandabackup
         server                  = /usr/local/libexec/amandad
         server                  = /usr/local/libexec/amandad
         server_args            = amandad
         server_args            = amandad
Line 89: Line 200:
= Links =
= Links =
* [https://webserver.brandeis.edu/pages/view/Bio/AmandaMacOSXCompileNotes Steven Karel's page on the topic]
* [https://webserver.brandeis.edu/pages/view/Bio/AmandaMacOSXCompileNotes Steven Karel's page on the topic]
* [http://www.locnar.net/drupal/?q=node/16 Locnar's "brain dump"]
* [http://developer.apple.com/macosx/backuponmacosx.html Apple's discussion of available backup utilities and their compatibility with extended attributes]
* [http://developer.apple.com/macosx/backuponmacosx.html Apple's discussion of available backup utilities and their compatibility with extended attributes]
* [[Building a Mac OS X Package for Amanda]]

Latest revision as of 00:15, 1 June 2007

Amanda has been tested to run on both Mac OS X Panther (10.3) and Tiger (10.4).

With Panther, the built-in tar does not record extended filesystem attributes (resource forks, finder flags, ACLs, and so on), so users who want to be able to restore those attributes will need to do some extra work (see below). Fortunately, Tiger's tar does support extended attributes, so an amanda installation will work "out of the box".

This page is summarized from writeups by Steven Karel and Dustin's work on Amanda.

General Setup

Set Up 'amandabackup' User

The following steps use 'niutil' to set up Amanda in the netinfo database, and then creae a home directory for the new user.

sudo niutil -create / /users/amandabackup
sudo niutil -createprop / /users/amandabackup shell /bin/bash
sudo niutil -createprop / /users/amandabackup realname "Backup User"
sudo niutil -createprop / /users/amandabackup uid 5000
sudo niutil -createprop / /users/amandabackup gid 0
sudo niutil -createprop / /users/amandabackup home /Users/amandabackup
sudo ditto -rsrcFork '/System/Library/User Template/English.lproj/' /Users/amandabackup
sudo sh -c "echo 'amanda_server.domain.com amandabackup' > /Users/amandabackup/.amandahosts"
sudo chown -R amandabackup:wheel /Users/amandabackup
sudo passwd amandabackup

Replace amanda_server.domain.com in the above with the name of your amanda server. This file is used as a basic security check to control which hosts can access amandad on this client.

System Tweaks

Add the following lines at the appropriate place in /etc/services (this isn't strictly necessary if you're not using kerberos security and the machine will only be an amanda client):

kamanda         10081/tcp   # amanda backup services (Kerberos)
kamanda         10081/udp   # amanda backup services (Kerberos)
amandaidx       10082/tcp   # amanda backup services
amidxtape       10083/tcp   # amanda backup services

Create /etc/amandates:

sudo touch /etc/amandates
sudo chmod 660 /etc/amandates
sudo chown -R amandabackup.wheel /etc/amandates

And set up some directories where Amanda can store small bits of data:

# TODO: get paths right for no --prefix
sudo mkdir -p /usr/local/lib/amanda
sudo touch /usr/local/lib/amanda/exclude.gtar
sudo mkdir -p /usr/local/var/amanda/gnutar-lists/
sudo chown -R amandabackup:wheel /usr/local/lib/amanda /usr/local/var/amanda/

Compile Amanda

Download and untar Amanda, then run ./configure as follows:

./configure --with-user=amandabackup --with-group=wheel 

You will want to examine ./configure --help first to see what other options are available. For example:

--without-server
just build the client components
--prefix
install somewhere other than /usr/local, etc.
--with-config
set the default configuration
--with-gnutar
give the path to GNU tar (especially useful on Panther; see below)
--without-xsltproc
don't build the manpages from XML (the XML parser is flaky)

This tutorial assumes that --prefix is left at the default, which installs everything (including configuration and state) under /usr/local. This helps to segregate amanda's information from files managed by Apple, and is probably best for end-user machines. If you will be actively working with the amanda configuration on these machines, you may want to consider:

--sysconfdir=/private/etc
store configuration in the usual place under /etc/amanda and /etc/amandates.
--localstatedir=/private/var
store state in the usual place under /var/amanda.

If you make these changes, you'll need to adjust the directories created in above.

To compile and install, follow the usual

make
sudo make install

Version-Specific Notes

Tiger

To get amandad to run when packets from the server arrive, you'll need a launchd script. See Apple's Getting started with launchd for background on this system.

Steven Karel has supplied a handy property list here, on which this version is based. You'll need to edit these slightly to give the correct path to amandad. The first runs amandad with BSDTCP authentication; the second uses BSDUDP authentication. These files will be available in contrib/macosx/resources in an upcoming release.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>org.amanda.amandad.bsdtcp</string>
	<key>UserName</key>
	<string>amandabackup</string>
	<key>GroupName</key>
	<string>wheel</string>
	<key>InitGroups</key>
	<true/>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/libexec/amandad</string>
		<string>-auth=bsdtcp</string>
	</array>
	<key>Sockets</key>
	<dict>
		<key>ipv4</key>
		<dict>
			<key>SockFamily</key>
			<string>IPv4</string>
			<key>SockServiceName</key>
			<string>amanda</string>
			<key>SockType</key>
			<string>stream</string>
		</dict>
		<key>ipv6</key>
		<dict>
			<key>SockFamily</key>
			<string>IPv6</string>
			<key>SockServiceName</key>
			<string>amanda</string>
			<key>SockType</key>
			<string>stream</string>
		</dict>
	</dict>
	<key>inetdCompatibility</key>
	<dict>
		<key>Wait</key>
		<false/>
	</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>GroupName</key>
	<string>wheel</string>
	<key>InitGroups</key>
	<true/>
	<key>Label</key>
	<string>org.amanda.amandad.bsdudp</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/libexec/amandad</string>
		<string>-auth=bsdudp</string>
	</array>
	<key>Sockets</key>
	<dict>
		<key>ipv4</key>
		<dict>
			<key>SockFamily</key>
			<string>IPv4</string>
			<key>SockServiceName</key>
			<string>amanda</string>
			<key>SockType</key>
			<string>dgram</string>
		</dict>
		<key>ipv6</key>
		<dict>
			<key>SockFamily</key>
			<string>IPv6</string>
			<key>SockServiceName</key>
			<string>amanda</string>
			<key>SockType</key>
			<string>dgram</string>
		</dict>
	</dict>
	<key>UserName</key>
	<string>amandabackup</string>
	<key>inetdCompatibility</key>
	<dict>
		<key>Wait</key>
		<true/>
	</dict>
</dict>
</plist>

Copy one or both of the property lists to /Library/LaunchDaemons, and load them with

sudo launchctl load -w /Library/LaunchDaemons/org.amanda.amandad.bsdudp.plist

You should see the following output from netstat:

me@mac ~ $ netstat -na | grep 10080
udp6       0      0  *.10080                *.*
udp4       0      0  *.10080                *.*

(or tcp6/4 for BSDTCP).

Panther

A user reports that for some versions of Mac OS X you may need to increase the UDP packetsize, as explained in UDP packet too large.

To support extended attributes on Panther,

  1. install either xtar or, if that doesn't work, hfstar
  2. compile Amanda, with the addition of the --with-gnutar=/path/to/new/tar flag to ./configure, giving the location of the new tar

To run amandad on Panther, you need to install an xinetd configuration snippet; create /etc/xinet.d/amanda with the following contents:

service amanda
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = amandabackup
        server                  = /usr/local/libexec/amandad
        server_args             = amandad
        groups                  = yes
        disable                 = no
}

(where server is the path at which you've installed amandad)

To start the service in xinetd:

service amanda start

If you have trouble, you may want to check that xinetd is running on the machine.

Links