Imported Upstream version 2.4.4p3
[debian/amanda] / docs / HOWTO-CYGWIN.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <html>
3 <head>
4   <meta name="GENERATOR" content="SGML-Tools 1.0.9">
5   <title>Amanda on Cygwin HOWTO</title>
6   <link href="amanda-cyg-howto-4.html" rel="next">
7   <link href="amanda-cyg-howto-2.html" rel="previous">
8   <link href="amanda-cyg-howto.html#toc3" rel="contents">
9   <meta name="author" content="Doug Kingston">
10 </head>
11 <body>
12 <h1 style="text-align: center;"><a name="s3">Amanda on Cygwin HOWTO</a></h1>
13 <p>by Doug Kingston, 30 January 2003.&nbsp; Based on Cygwin 1.3.18, and
14 Amanda 2.4.3-20021027 and some fixes which will be in the official
15 release by the time you see this.<br>
16 </p>
17 <p>With thanks to Enrico Bernardini from whom I have borrowed some
18 material from an earlier attempt at documenting the installation of
19 Amanda on Cygwin in 2001.&nbsp; Please send annotations and corrections
20 to amanda-hackers@amanda.org. I can be reached as dpk (at)
21 randomnotes.org (do the obvious).<br>
22 </p>
23 <h2><a name="Install">1. Install Cygwin</a></h2>
24 <h2> </h2>
25 <p> The following Cygwin packages are required for binary installation
26 (may be incomplete): </p>
27 <ul>
28   <li> Category BASE: standard</li>
29   <li>Category MISC: gzip<br>
30   </li>
31   <li>Category MISC: tar<br>
32   </li>
33   <li> Category NET: inetutils</li>
34 </ul>
35 <p> You need also these packages to build from source (may be
36 incomplete): </p>
37 <ul>
38   <li> Category DEVELOP: ALL</li>
39   <li> Category INTERPRETERS: m4, gawk ?</li>
40   <li> Category LIBS:<span style="font-style: italic;">default
41 selection? (libc, libiconv, others?)<br>
42     </span></li>
43 </ul>
44 I have most or the basic utilities and libraries installed so I cannot
45 give you a more specific list of what is required.&nbsp; If someone has
46 a more definitive list, I would appreciate and email to amanda-hackers.<br>
47 <br>
48 One user reported some problems with access rights when running under
49 Cygwin, which he solved by setting the CYGWIN environment variable to
50 nontsec.&nbsp; I do not believe this is necessary if you run the amanda
51 daemon as System (see below).<br>
52 <p> </p>
53 <h2><a name="Compile"></a>2. Other Preparation</h2>
54 When doing backups on a NT, Windows 2000 or Windows XP system, the
55 choice of user and group will be important if you are to properly
56 interact with the security mechanisms of these more modern Microsoft
57 product.&nbsp; For Windows 95/98/ME this is probably a non-issue.&nbsp;
58 The most privileged account on the Windows systems is 'System', and I
59 have chosen to use this account for Amanda backups to ensure that I can
60 access the widest set of files.&nbsp; On Unix we would run as root, with
61 equivalent access permissions.&nbsp; I have also chose to run under the
62 'Administrators' group, another standard Windows group.&nbsp; Ensure
63 these exist before you continue - or identify another account to
64 use.&nbsp; The Cygwin installation postinstall script should have
65 already populated /etc/passwd and /etc/group with these entries.<br>
66 <ul>
67   <li>Make sure that System (or SYSTEM) has a home directory specified
68 in /etc/passwd.</li>
69 </ul>
70 I used <span style="font-family: monospace;">/home/root</span>.&nbsp;
71 You'll need to put the .amandahosts file here later.&nbsp; The relevant
72 lines from my /etc/passwd file are:<br>
73 <div style="margin-left: 40px;"><span style="font-family: monospace;">SYSTEM:*:18:18:,S-1-5-18:/home/root:</span><br
74  style="font-family: monospace;">
75 <span style="font-family: monospace;">root:*:18:18:,S-1-5-18:/home/root:</span></div>
76 <h2><a name="Compile">3. Compile Amanda</a></h2>
77 After installing Cygwin, unpack the Amanda sources, typically in
78 /usr/src/amanda or something similar.&nbsp; In the Amanda directory, you
79 will need to execute:<br>
80 <div style="margin-left: 40px;"><span style="font-family: monospace;">automake&nbsp;
81 # this may not be necessary in the official release</span><br
82  style="font-family: monospace;">
83 <span style="font-family: monospace;">autoconf&nbsp; # this may not be
84 necessary in the official release</span><br
85  style="font-family: monospace;">
86 <span style="font-family: monospace;">&nbsp;</span><br
87  style="font-family: monospace;">
88 <span style="font-family: monospace;">./configure --without-server \</span><br
89  style="font-family: monospace;">
90 <span style="font-family: monospace;">&nbsp; --without-force-uid \</span><br
91  style="font-family: monospace;">
92 <span style="font-family: monospace;">&nbsp; --with-user=<span
93  style="font-style: italic;">yourlogin</span> \</span><br
94  style="font-family: monospace;">
95 <span style="font-family: monospace;">&nbsp; --with-group=Administrators</span><br
96  style="font-family: monospace;">
97 <span style="font-family: monospace;">make</span><br
98  style="font-family: monospace;">
99 <span style="font-family: monospace;">make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
100 # yes, I needed to run it a second time</span><br
101  style="font-family: monospace;">
102 <span style="font-family: monospace;">make install</span><br>
103 </div>
104 <br>
105 The use of&nbsp; your own login instead of SYSTEM requires some
106 explanation.&nbsp; If you were to call runconfigure with SYSTEM instead
107 of your own login id as part of the -with-user parameter, the
108 installation process will fail due to the way Cygwin and the NT/W2K/XP
109 security system interact.&nbsp; Once you chown a file to another user
110 (like SYSTEM) you are no longer able to chgrp or chmod the file.&nbsp;
111 The installations process will abort at this point.&nbsp; By installing
112 the files owned by yourself, you will be able to chgrp and chmod them
113 as expected.&nbsp; Note that you still RUN as SYSTEM from inetd.conf
114 (see below).<br>
115 <h2><a name="Configure">4. Configure Cygwin files</a> </h2>
116 <p>You have to modify some config files: </p>
117 <ul>
118   <li>/etc/inetd.conf: cleanup un-needed entries:</li>
119 </ul>
120 <p style="margin-left: 40px;">Comment out any entries you do not need
121 by placing a '#' at the start of the lines.&nbsp; This is just good
122 practice, and if any of the entries reference non-existent users (e.g.
123 uucp) inetd may not start up.</p>
124 <ul>
125   <li> /etc/inetd.conf: add
126     <blockquote><code> amanda  dgram   udp     wait    System
127 /usr/local/libexec/amandad amandad </code></blockquote>
128 ATTENTION: Use tabs, don't use spaces.<br>
129   </li>
130 </ul>
131 <ul>
132   <li> create <span style="font-family: monospace;">/home/root/.amandahosts</span>
133 (or whereever System's home directory is):
134     <pre> &lt;amanda server&gt; &lt;amanda user&gt; <br></pre>
135   </li>
136 </ul>
137 Then create the following AMANDA directories and the amandates file:
138 <blockquote><code> mkdir -p /usr/local/var/amanda/gnutar-lists<br>
139   <br>
140 mkdir /tmp/amanda<br>
141   <br>
142 touch /etc/amandates<br>
143   </code></blockquote>
144 <h2><a name="Configure">5. Configure Windows system files</a> </h2>
145 Update the Windows services list<br>
146 <ul>
147   <li> &lt;WINDIR&gt;\Services: add
148     <blockquote><code> amanda              10080/udp                   #
149 amanda backup services<br>
150 amandaidx           10082/tcp                   # amanda backup services<br>
151 amidxtape           10083/tcp                   # amanda backup services<br>
152       </code></blockquote>
153   </li>
154 </ul>
155 where WINDIR is C:\WINNT\system32\drivers\etc or something
156 similar.&nbsp; The last two lines are needed if you want to use
157 amrecover.<br>
158 <br>
159 Ensure that the default Windows PATH environment variable include your
160 Cygwin /bin directory.&nbsp; This is necessary since inetd and hence the
161 amandad that it spawns will not have the advantage of being started by
162 the standard bash shell startup script and won't find the needed dynamic
163 libraries (e.g. cygwin1.dll). My PATH is:<br>
164 <span style="font-family: monospace;"><br>
165 &nbsp;
166 %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\cygwin\bin</span><br>
167 <br>
168 This is on XP; My Computer, right click - Properties, click on
169 Environment Variables (at the bottom).&nbsp; Yours may vary, but make
170 sure the Cygwin bin directory is represented somewhere in the PATH.<br>
171 <p> </p>
172 <h2><a name="Inetd">6. Configure Inetd to run automatically as a service</a> </h2>
173 <p>If you want to test your installation, you can call inetd from bash
174 prompt: </p>
175 <blockquote><code> /usr/sbin/inetd -d </code></blockquote>
176 <p> </p>
177 <h3>Windows 98/ME<br>
178 </h3>
179 <p> </p>
180 <ul>
181   <li> To start after the user logs in: Create a shortcut to
182     <pre>c:\cygwin\usr\sbin\inetd.exe<br></pre>
183 in
184     <pre>&lt;WINDIR&gt;\start menu\programs\startup<br></pre>
185   </li>
186   <li> To start before the user logs in: Add the string key
187     <pre>CygwinInetd=C:\cygwin\usr\sbin\inetd.exe<br></pre>
188 under
189     <pre>HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices<br></pre>
190 in the registry. You'll see a dos-like window on the startup: I not
191 found a solution to iconize or to make invisible (suggestions are
192 welcome).</li>
193 </ul>
194 <h3>Windows NT/2000/XP</h3>
195 <p>From bash prompt, type: </p>
196 <pre> /usr/sbin/inetd --install-as-service<br></pre>
197 Then, to start/stop inetd service use the Services control panel or the
198 following Windows command:
199 <pre> net start/stop inetd<br></pre>
200 <h2><a name="Notes"></a>7. Notes on Amanda backup options</h2>
201 <p><span style="font-weight: bold; text-decoration: underline;">Compression</span><br>
202 Currently, client side compression does not work, probably due to
203 problems in pipe emulation in Cygwin.&nbsp; I have not tried to debug
204 this yet.&nbsp; This may be addressed in a subsequent release, or it
205 could be fixed in later releases of Cygwin.&nbsp; Due to this issue, we
206 recommend that if you want compressed dumps from Windows clients, you
207 configure Amanda for server compression in amanda.conf on your Amanda
208 server:</p>
209 <div style="margin-left: 40px;"><span style="font-family: monospace;">define
210 dumptype srv-comp-tar {</span><br style="font-family: monospace;">
211 <span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; global</span><br
212  style="font-family: monospace;">
213 <span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; comment
214 "partitions dumped via tar with server compression"</span><br
215  style="font-family: monospace;">
216 <span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; program
217 "GNUTAR"</span><br style="font-family: monospace;">
218 <span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; compress
219 server fast</span><br style="font-family: monospace;">
220 <span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; exclude list
221 ".amanda.exclude"</span><br style="font-family: monospace;">
222 <span style="font-family: monospace;">}</span></div>
223 <p><span style="font-weight: bold; text-decoration: underline;">Exclude
224 Lists</span><br>
225 A note on exclude lists is also in order.&nbsp; If you specify a
226 relative path, it will be expect ed that the file is in or relative to
227 the root of the directory you are planning to dump.&nbsp; Typically this
228 will not be '/' but '/cygdrive/c' or something similar if you want to
229 get the Windows files and the Cygwin files.&nbsp; '/' is taken to be the
230 root of the Cygwin tree, normally something like C:\cygwin or possibly
231 C:\Program Files\cygwin.</p>
232 <p><span style="font-weight: bold; text-decoration: underline;">Debugging
233 Files</span><br>
234 Amanda will leave debugging files in /tmp/amanda if it exists.&nbsp; I
235 have recommended creating the directory above.&nbsp; <br>
236 </p>
237 <p><br>
238 </p>
239 </body>
240 </html>