Debian Codegraph @

manuals/en/utility/bimagemgr-chapter.tex

raw
1 \section{bimagemgr}
2 \label{blb:bimagemgr}
3 \index[general]{Bimagemgr}
4
5 \btool{bimagemgr} is a utility for those who backup to disk volumes in order to
6 commit them to CDR disk, rather than tapes. It is a web based interface
7 written in Perl and is used to monitor when a volume file needs to be burned to
8 disk. It requires:
9
10 \begin{bitemize}
11 \item A web server running on the bacula server
12 \item A CD recorder installed and configured on the bacula server
13 \item The cdrtools package installed on the bacula server.
14 \item \btool{perl}, \texttt{perl-DBI} module, and either \texttt{DBD-MySQL} \texttt{DBD-SQLite} or \texttt{DBD-PostgreSQL} modules
15 \end{bitemize}
16
17 DVD burning is not supported by \btool{bimagemgr} at this
18 time, but both are planned for future releases.
19
20 \subsection{bimagemgr installation}
21 \index[general]{bimagemgr!Installation}
22 \index[general]{bimagemgr Installation}
23
24 Installation from tarball:
25 \begin{benumerate}
26 % TODO: use itemized list for this?
27 %% done by Philippe 22 dev 2016
28 \item Examine the \bfilename{Makefile} and adjust it to your configuration if needed.
29 \item Edit \bfilename{config.pm} to fit your configuration.
30 \item Do \btool{make install} as \texttt{root}.
31 \item Edit \bfilename{httpd.conf} and change the Timeout value. The web server must not time
32 out and close the connection before the burn process is finished. The exact
33 value needed may vary depending upon your \acs{CD} recorder speed and whether you are
34 burning on the \bacula{} server on on another machine across your network. In my
35 case I set it to 1000 seconds. Restart \btool{httpd}.
36 \item Make sure that cdrecord is \btool{setuid} \texttt{root}.
37 % TODO: I am pretty sure cdrecord can be used without setuid \texttt{root}
38 % TODO: as long as devices are setup correctly
39 \end{benumerate}
40
41 Installation from rpm package:
42 % TODO: use itemized list for this?
43 \begin{benumerate}
44 \item Install the rpm package for your platform.
45 \item Edit \bfilename{/cgi-bin/config.pm} to fit your configuration.
46 \item Edit \bfilename{httpd.conf} and change the Timeout value. The web server must not time
47 out and close the connection before the burn process is finished. The exact
48 value needed may vary depending upon your cd recorder speed and whether you are
49 burning on the bacula server on on another machine across your network. In my
50 case I set it to 1000 seconds. Restart \btool{httpd}.
51 \item Make sure that cdrecord is \btool{setuid} \texttt{root}.
52 \end{benumerate}
53 For \bacula{} systems less than 1.36:
54 \begin{benumerate}
55 % TODO: use itemized list for this?
56 \item Edit the configuration section of \bfilename{config.pm} to fit your configuration.
57 \item Run \bfilename{/etc/bacula/create\_cdimage\_table.pl} from a console on your \bacula{}
58 server (as \texttt{root}) to add the CDImage table to your bacula database.
59 \end{benumerate}
60 Accessing the Volume files:
61 The Volume files by default have permissions \bdefaultvalue{640} and can only be read by \texttt{root}.
62 The recommended approach to this is as follows (and only works if \btool{bimagemgr} and \btool{apache}
63 are running on the same host as \bacula{}.
64
65 For bacula-1.34 or 1.36 installed from tarball -
66 \begin{benumerate}
67 % TODO: use itemized list for this?
68 \item Create a new user group \texttt{bacula} and add the user \texttt{apache} to the group for
69 Red Hat or Mandrake systems. For SuSE systems add the user \texttt{wwwrun} to the
70 \texttt{bacula} group.
71 \item Change ownership of all of your Volume files to \texttt{root}.\texttt{bacula}
72 \item Edit the \bfilename{/etc/bacula/bacula} startup script and set SD\_USER=root and
73 SD\_GROUP=bacula. Restart \btool{bacula}.
74 \end{benumerate}
75 Note: step 3 should also be done in \bfilename{/etc/init.d/bacula-sd} but released versions
76 of this file prior to 1.36 do not support it. In that case it would be necessary after
77 a reboot of the server to execute \btool{/etc/bacula/bacula restart}.
78
79 For bacula-1.38 installed from tarball -
80 \begin{benumerate}
81 % TODO: use itemized list for this?
82 \item Your configure statement should include:
83 % TODO: fix formatting here
84 % Done. Philippe 22 dec 2016
85 \begin{bVerbatim}
86 --with-dir-user=bacula
87 --with-dir-group=bacula
88 --with-sd-user=bacula
89 --with-sd-group=disk
90 --with-fd-user=root
91 --with-fd-group=bacula
92 \end{bVerbatim}
93 \item Add the user \texttt{apache} to the \texttt{bacula} group for Red Hat or Mandrake systems.
94 For SuSE systems add the user \texttt{wwwrun} to the \texttt{bacula} group.
95 \item Check/change ownership of all of your Volume files to \texttt{root}.\texttt{bacula}
96 \end{benumerate}
97
98 For bacula-1.36 or bacula-1.38 installed from rpm -
99 \begin{benumerate}
100 % TODO: use itemized list for this?
101 \item Add the user \texttt{apache} to the group \texttt{bacula} for Red Hat or Mandrake systems.
102 For SuSE systems add the user \texttt{wwwrun} to the \texttt{bacula} group.
103 \item Check/change ownership of all of your Volume files to \texttt{root}.\texttt{bacula}
104 \end{benumerate}
105
106 \btool{bimagemgr} installed from rpm \gt{} 1.38.9 will add the web server user to the
107 \texttt{bacula} group in a post install script. Be sure to edit the configuration
108 information in \bfilename{config.pm} after installation of rpm package.
109
110 \btool{bimagemgr} will now be able to read the Volume files but they are still not
111 world readable.
112
113 If you are running \btool{bimagemgr} on another host (not recommended) then you will
114 need to change the permissions on all of your backup volume files to 644 in
115 order to access them via \acs{NFS} share or other means. This approach should only
116 be taken if you are sure of the security of your environment as it exposes
117 the backup Volume files to world read.
118
119 \subsection{bimagemgr usage}
120 \index[general]{bimagemgr!Usage}
121 \index[general]{bimagemgr Usage}
122
123 % TODO: use tex to say figure number => done.
124 Calling the program in your web browser, e.g. \url{http://localhost/cgi-bin/bimagemgr.pl} will produce a display as shown below in Figure \vref{fig:util:bimagemgr1}. The program will query the bacula database and display all volume
125 files with the date last written and the date last burned to disk. If a volume
126 needs to be burned (last written is newer than last burn date) a ``Burn''
127 button will be displayed in the rightmost column.
128
129 \bimageH{bimagemgr1}{\bacula{} CD Image Manager}{fig:util:bimagemgr1}
130
131 Place a blank CDR disk in your recorder and click the ``Burn'' button. This will
132 cause a pop up window as shown in Figure \vref{fig:util:bimagemgr2} to display the burn progress.
133 % TODO: use tex to say figure number
134
135 \bimageH{bimagemgr2}{\bacula{} CD Image Burn Progress Window}{fig:util:bimagemgr2}
136 % TODO: use tex to say figure number
137
138 When the burn finishes the pop up window will display the results of cdrecord
139 % TODO: use tex to say figure number
140 as shown in Figure \vref{fig:util:bimagemgr3}. Close the pop up window and refresh the main window. The
141 last burn date will be updated and the ``Burn'' button for that volume will
142 disappear. Should you have a failed burn you can reset the last burn date of
143 that volume by clicking its ``Reset'' link.
144
145 \bimageH{bimagemgr3}{\bacula{} CD Image Burn Results}{fig:util:bimagemgr3}
146 % TODO: use tex to say figure number
147
148 In the bottom row of the main display window are two more buttons labeled
149 ``Burn Catalog'' and ``Blank CDRW''. ``Burn Catalog'' will place a copy of
150 your \bacula{} catalog on a disk. If you use CDRW disks rather than CDR then
151 ``Blank CDRW'' allows you to erase the disk before re-burning it. Regularly
152 committing your backup volume files and your catalog to disk with \btool{bimagemgr}
153 ensures that you can rebuild easily in the event of some disaster
154 on the \bacula{} server itself.