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