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