]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/de/utility/rpm-faq.tex
Reset everything to English
[bacula/docs] / docs / manuals / de / utility / rpm-faq.tex
1 %%
2 %%
3
4 \chapter{Bacula RPM Packaging FAQ}
5 \label{RpmFaqChapter}
6 \index[general]{FAQ!Bacula\textsuperscript{\textregistered} - RPM Packaging }
7 \index[general]{Bacula\textsuperscript{\textregistered} - RPM Packaging FAQ }
8
9 \begin{enumerate}
10 \item 
11    \ilink{How do I build Bacula for platform xxx?}{faq1}  
12 \item 
13    \ilink{How do I control which database support gets built?}{faq2} 
14
15 \item 
16    \ilink{What other defines are used?}{faq3}  
17 \item 
18    \ilink{I'm getting errors about not having permission when I try to build the
19    packages. Do I need to be root?}{faq4}  
20 \item 
21    \ilink{I'm building my own rpms but on all platforms and compiles I get an
22    unresolved dependency for something called
23    /usr/afsws/bin/pagsh.}{faq5} 
24 \item 
25    \ilink{I'm building my own rpms because you don't publish for my platform.
26     Can I get my packages released to sourceforge for other people to use?}{faq6} 
27 \item 
28    \ilink{Is there an easier way than sorting out all these command line options?}{faq7}
29 \item 
30    \ilink{I just upgraded from 1.36.x to 1.38.x and now my director daemon won't start. It appears to start but dies silently and I get a "connection refused" error when starting the console. What is wrong?}{faq8}  
31 \item 
32    \ilink{There are a lot of rpm packages. Which packages do I need for what?}{faq9}  
33 \end{enumerate}
34
35 \section{Answers}
36 \index[general]{Answers }
37
38 \begin{enumerate}
39 \item 
40    \label{faq1}
41    {\bf How do I build Bacula for platform xxx?}
42    The bacula spec file contains defines to build for several platforms: \\
43    \\
44    Red Hat 7.x (rh7), Red Hat 8.0 (rh8), Red Hat 9 (rh9), \\
45    Fedora Core (fc1, fc3, fc4, fc5, fc6, fc7, fc8), \\
46    Whitebox Enterprise Linux 3.0 (wb3), \\
47    Red Hat Enterprise Linux (rhel3, rhel4, rhel5), \\
48    Mandrake 10.x (mdk), Mandriva 2006.x (mdv), \\ 
49    CentOS (centos3, centos4, centos5) \\ 
50    Scientific Linux (sl3, sl4, sl5) and \\
51    SuSE (su9, su10, su102, su103, su110). \\
52    \\
53    The package build is controlled by a mandatory define set at the beginning of the file.  These defines basically just control the dependency information that gets coded into the finished rpm package as well 
54    as any special configure options required.  The platform define may be edited 
55    in the spec file directly (by default all defines are set to 0 or "not set").  
56    For example, to build the Red Hat 7.x package find the line in the spec file
57    which reads
58
59 \footnotesize
60 \begin{verbatim}
61         %define rh7 0
62         
63 \end{verbatim}
64 \normalsize
65
66 and edit it to read  
67
68 \footnotesize
69 \begin{verbatim}
70         %define rh7 1
71         
72 \end{verbatim}
73 \normalsize
74
75 Alternately you may pass the define on the command line when calling rpmbuild:
76  
77
78 \footnotesize
79 \begin{verbatim}
80         rpmbuild -ba --define "build_rh7 1" bacula.spec
81         rpmbuild --rebuild --define build_rh7 1" bacula-x.x.x-x.src.rpm
82         
83 \end{verbatim}
84 \normalsize
85
86 \item 
87    \label{faq2}
88    {\bf How do I control which database support gets built?}
89    Another mandatory build define controls which database support is compiled,
90    one of  build\_sqlite, build\_mysql or build\_postgresql. To get the MySQL
91    package and support either  set the  
92
93 \footnotesize
94 \begin{verbatim}
95         %define mysql 0
96         OR
97         %define mysql4 0
98         OR
99         %define mysql5 0
100         
101 \end{verbatim}
102 \normalsize
103
104 to  
105
106 \footnotesize
107 \begin{verbatim}
108         %define mysql 1
109         OR
110         %define mysql4 1
111         OR
112         %define mysql5 1
113         
114 \end{verbatim}
115 \normalsize
116
117 in the spec file directly or pass it to rpmbuild on the command line:  
118
119 \footnotesize
120 \begin{verbatim}
121         rpmbuild -ba --define "build_rh7 1" --define "build_mysql 1" bacula.spec
122         rpmbuild -ba --define "build_rh7 1" --define "build_mysql4 1" bacula.spec
123         rpmbuild -ba --define "build_rh7 1" --define "build_mysql5 1" bacula.spec
124         
125 \end{verbatim}
126 \normalsize
127
128 \item 
129    \label{faq3}
130    {\bf What other defines are used?} \\
131    Three other building defines of note are the depkgs\_version, docs\_version and
132    \_rescuever identifiers. These  two defines are set with each release and must 
133    match the version of those sources that are being used to build the packages. 
134    You would not ordinarily need to edit these.  See also the Build Options section 
135    below for other build time options that can be passed on the command line.
136 \item 
137    \label{faq4}
138    {\bf I'm getting errors about not having permission when I try  to build the
139    packages. Do I need to be root?} \\
140    No, you do not need to be root and, in fact, it is better practice to
141    build rpm packages as a non-root user.  Bacula packages are designed to
142    be built by a regular user but you must make a few changes on your
143    system to do this.  If you are building on your own system then the
144    simplest method is to add write permissions for all to the build
145    directory (/usr/src/redhat/, /usr/src/RPM or /usr/src/packages).  
146    To accomplish this, execute the following command as root:
147
148 \footnotesize
149 \begin{verbatim}
150         chmod -R 777 /usr/src/redhat
151         chmod -R 777 /usr/src/RPM
152         chmod -R 777 /usr/src/packages
153         
154 \end{verbatim}
155 \normalsize
156
157 If you are working on a shared system where you can not use the method
158 above then you need to recreate the appropriate above directory tree with all
159 of its subdirectories inside your home directory.  Then create a file named
160
161 {\tt .rpmmacros} 
162
163 in your home directory (or edit  the file if it already exists)
164 and add the following line:  
165
166 \footnotesize
167 \begin{verbatim}
168         %_topdir /home/myuser/redhat
169         %_tmppath /tmp
170         
171 \end{verbatim}
172 \normalsize
173
174 Another handy directive for the .rpmmacros file if you wish to suppress the
175 creation of debug rpm packages is:
176
177 \footnotesize
178 \begin{verbatim}
179         %debug_package %{nil}
180         
181 \end{verbatim}
182
183 \normalsize
184
185 \item 
186    \label{faq5}
187    {\bf I'm building my own rpms but on all platforms and compiles I get an
188    unresolved dependency for something called /usr/afsws/bin/pagsh.} \\
189    This is a shell from the OpenAFS (Andrew File System).  If you are
190    seeing this then you chose to include the docs/examples directory in
191    your package.  One of the example scripts in this directory is a pagsh
192    script.  Rpmbuild, when scanning for dependencies, looks at the shebang
193    line of all packaged scripts in addition to checking shared libraries.
194    To avoid this do not package the examples directory.  If you are seeing
195    this problem you are building a very old bacula package as the examples
196    have been removed from the doc packaging.
197
198 \item 
199    \label{faq6}
200    {\bf I'm building my own rpms because you don't publish for my platform.
201     Can I get my packages released to sourceforge for other people to use?}
202     \\
203     Yes, contributions from users are accepted and appreciated.  Please
204     examine the directory platforms/contrib-rpm in the source code for
205     further information.
206
207 \item 
208    \label{faq7}
209    {\bf Is there an easier way than sorting out all these command line options?}
210    \\
211    Yes, there is a gui wizard shell script which you can use to rebuild the
212    src rpm package.  Look in the source archive for
213    platforms/contrib-rpm/rpm\_wizard.sh.  This script will allow you to
214    specify build options using GNOME dialog screens.  It requires zenity.
215
216 \item 
217    \label{faq8}
218    {\bf I just upgraded from 1.36.x to 1.38.x and now my director daemon
219 won't start.  It appears to start but dies silently and I get a "connection
220 refused" error when starting the console.  What is wrong?} \\
221    Beginning with 1.38 the rpm packages are configured to run the director
222    and storage daemons as a non-root user.  The file daemon runs as user
223    root and group bacula, the storage daemon as user bacula and group disk,
224    and the director as user bacula and group bacula.  If you are upgrading
225    you will need to change some file permissions for things to work.
226    Execute the following commands as root:
227
228 \footnotesize
229 \begin{verbatim}
230         chown bacula.bacula /var/bacula/*
231         chown root.bacula /var/bacula/bacula-fd.9102.state
232         chown bacula.disk /var/bacula/bacula-sd.9103.state
233         
234 \end{verbatim}
235 \normalsize
236
237 Further, if you are using File storage volumes rather than tapes those
238 files will also need to have ownership set to user bacula and group bacula.
239
240 \item 
241    \label{faq9}
242    {\bf There are a lot of rpm packages.  Which packages do I need for
243 what?} \\
244 For a bacula server you need to select the packsge based upon your
245 preferred catalog database: one of bacula-mysql, bacula-postgresql or
246 bacula-sqlite.  If your system does not provide an mtx package you also
247 need bacula-mtx to satisfy that dependancy.  For a client machine you need
248 only install bacula-client.  Optionally, for either server or client
249 machines, you may install a graphical console bacula-gconsole and/or
250 bacula-wxconsole. The Bacula Administration Tool is installed with the 
251 bacula-bat package.  One last package, bacula-updatedb is required only when
252 upgrading a server more than one database revision level.
253
254
255
256 \item {\bf Support for RHEL3/4/5, CentOS 3/4/5, Scientific Linux 3/4/5 and x86\_64}
257    \\
258    The examples below show
259    explicit build support for RHEL4 and CentOS 4. Build support 
260    for x86\_64 has also been added. 
261 \end{enumerate}
262
263 \footnotesize
264 \begin{verbatim}
265 Build with one of these 3 commands:
266
267 rpmbuild --rebuild \
268         --define "build_rhel4 1" \
269         --define "build_sqlite 1" \
270         bacula-1.38.3-1.src.rpm
271
272 rpmbuild --rebuild \
273         --define "build_rhel4 1" \
274         --define "build_postgresql 1" \
275         bacula-1.38.3-1.src.rpm
276
277 rpmbuild --rebuild \
278         --define "build_rhel4 1" \
279         --define "build_mysql4 1" \
280         bacula-1.38.3-1.src.rpm
281
282 For CentOS substitute '--define "build_centos4 1"' in place of rhel4. 
283 For Scientific Linux substitute '--define "build_sl4 1"' in place of rhel4.
284
285 For 64 bit support add '--define "build_x86_64 1"'
286 \end{verbatim}
287 \normalsize
288
289 \section{Build Options}
290 \index[general]{Build Options}
291 The spec file currently supports building on the following platforms:
292 \footnotesize
293 \begin{verbatim}
294 Red Hat builds
295 --define "build_rh7 1"
296 --define "build_rh8 1"
297 --define "build_rh9 1"
298
299 Fedora Core build
300 --define "build_fc1 1"
301 --define "build_fc3 1"
302 --define "build_fc4 1"
303 --define "build_fc5 1"
304 --define "build_fc6 1"
305 --define "build_fc7 1"
306 --define "build_fc8 1"
307 --define "build_fc9 1"
308
309 Whitebox Enterprise build
310 --define "build_wb3 1"
311
312 Red Hat Enterprise builds
313 --define "build_rhel3 1"
314 --define "build_rhel4 1"
315 --define "build_rhel5 1"
316
317 CentOS build
318 --define "build_centos3 1"
319 --define "build_centos4 1"
320 --define "build_centos5 1"
321
322 Scientific Linux build
323 --define "build_sl3 1"
324 --define "build_sl4 1"
325 --define "build_sl5 1"
326
327 SuSE build
328 --define "build_su9 1"
329 --define "build_su10 1"
330 --define "build_su102 1"
331 --define "build_su103 1"
332 --define "build_su110 1"
333 --define "build_su111 1"
334
335 Mandrake 10.x build
336 --define "build_mdk 1"
337
338 Mandriva build
339 --define "build_mdv 1"
340
341 MySQL support:
342 for mysql 3.23.x support define this
343 --define "build_mysql 1"
344 if using mysql 4.x define this,
345 currently: Mandrake 10.x, Mandriva 2006.0, SuSE 9.x & 10.0, FC4 & RHEL4
346 --define "build_mysql4 1"
347 if using mysql 5.x define this,
348 currently: SuSE 10.1 & FC5
349 --define "build_mysql5 1"
350
351 PostgreSQL support:
352 --define "build_postgresql 1"
353
354 Sqlite support:
355 --define "build_sqlite 1"
356
357 Build the client rpm only in place of one of the above database full builds:
358 --define "build_client_only 1"
359
360 X86-64 support:
361 --define "build_x86_64 1"
362
363 Supress build of bgnome-console:
364 --define "nobuild_gconsole 1"
365
366 Build the WXWindows console:
367 requires wxGTK >= 2.6
368 --define "build_wxconsole 1"
369
370 Build the Bacula Administration Tool:
371 requires QT >= 4.2
372 --define "build_bat 1"
373
374 Build python scripting support:
375 --define "build_python 1"
376
377 Modify the Packager tag for third party packages:
378 --define "contrib_packager Your Name <youremail@site.org>"
379
380 Install most files to /opt/bacula directory:
381 --define "single_dir_install 1"
382
383 Build the rescue files:
384 --define "build_rescue 1"
385
386 \end{verbatim}
387 \normalsize
388
389 \section{RPM Install Problems}
390 \index[general]{RPM Install Problems}
391 In general the RPMs, once properly built should install correctly.
392 However, when attempting to run the daemons, a number of problems
393 can occur:
394 \begin{itemize}
395 \item Wrong /var/bacula Permissions \\
396   By default, the Director and Storage daemon do not run with
397   root permission. If the /var/bacula is owned by root, then it
398   is possible that the Director and the Storage daemon will not
399   be able to access this directory, which is used as the Working
400   Directory. To fix this, the easiest thing to do is:
401 \begin{verbatim}
402   chown bacula:bacula /var/bacula
403 \end{verbatim}
404   Note: as of 1.38.8 /var/bacula is installed root:bacula with
405   permissions 770.
406 \item The Storage daemon cannot Access the Tape drive \\
407   This can happen in some older RPM releases where the Storage
408   daemon ran under userid bacula, group bacula.  There are two
409   ways of fixing this: the best is to modify the /etc/init.d/bacula-sd
410   file so that it starts the Storage daemon with group "disk".
411   The second way to fix the problem is to change the permissions
412   of your tape drive (usually /dev/nst0) so that Bacula can access it.
413   You will probably need to change the permissions of the SCSI control
414   device as well, which is usually /dev/sg0.  The exact names depend
415   on your configuration, please see the Tape Testing chapter for
416   more information on devices.
417 \end{itemize}
418