From 20c451d8fe9539b31bf5a47440c207d7c1803558 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Thu, 21 Feb 2013 17:27:58 +0100 Subject: [PATCH 1/2] Create quickstart files and remove bacula-checkconf stuff --- README.Fedora | 64 ++------------------------------------- bacula-checkconf | 17 ----------- bacula-dir.init | 1 - bacula-dir.service | 1 - bacula-fd.init | 1 - bacula-fd.service | 1 - bacula-sd.init | 1 - bacula-sd.service | 1 - bacula.spec | 9 +++--- quickstart_mysql.txt | 59 ++++++++++++++++++++++++++++++++++++ quickstart_postgresql.txt | 61 +++++++++++++++++++++++++++++++++++++ quickstart_sqlite3.txt | 56 ++++++++++++++++++++++++++++++++++ 12 files changed, 184 insertions(+), 88 deletions(-) delete mode 100644 bacula-checkconf create mode 100644 quickstart_mysql.txt create mode 100644 quickstart_postgresql.txt create mode 100644 quickstart_sqlite3.txt diff --git a/README.Fedora b/README.Fedora index 528d35b..4d93582 100644 --- a/README.Fedora +++ b/README.Fedora @@ -34,65 +34,7 @@ There are 3 programs which provide 'libbaccats.so'. Enter to keep the current selection[+], or type selection number: 1 -======== Quick installation guide with the default PostgreSQL backend - -Perform the following commands to install Bacula with its default configuration -and all daemons and consoles in one server. - -1) Install packages - -# yum -y install postgresql-server bacula-director bacula-storage \ - bacula-client bacula-console bacula-console-bat - -2) Create database - -# postgresql-setup initdb -# systemctl enable postgresql.service -# systemctl start postgresql.service -# su - postgres -$ cd /usr/libexec/bacula -$ ./create_bacula_database -$ ./make_bacula_tables -$ ./grant_bacula_privileges - -3) Change passwords in /etc/bacula/*conf with something you like. The default - configuration prevents startup if there is any "filler" password in the - configuration files. - -# sed -i -e 's/@@DIR_PASSWORD@@/dir-Fedora/g' \ - -e 's/@@FD_PASSWORD@@/fd-Fedora/g' \ - -e 's/@@SD_PASSWORD@@/sd-Fedora/g' \ - -e 's/@@MON_DIR_PASSWORD@@/mon-dir-Fedora/g' \ - -e 's/@@MON_FD_PASSWORD@@/mon-fd-Fedora/g' \ - -e 's/@@MON_SD_PASSWORD@@/mon-sd-Fedora/g' \ - /etc/bacula/*conf - -4) Enable daemons and check they are working - -# systemctl enable bacula-dir.service -# systemctl enable bacula-sd.service -# systemctl enable bacula-fd.service - -# systemctl start bacula-dir.service -# echo status bacula-dir | bconsole - -# systemctl start bacula-sd.service -# echo status bacula-sd | bconsole - -# systemctl start bacula-fd.service -# echo status bacula-fd | bconsole - -5) Install the docs and read them - -# yum -y install bacula-docs - -6) If you don't backup to disk and have a tape library or autochanger, please -also install the magnetic tapes commands: - -# yum -y install mt-st mtx - - -======== Bugs - -Please file bugs against the appropriate component using the Fedora version. +There is NO need to edit any part in the Bacula Director configuration. +Please look at the quickstart_.txt files for a quick start with the +various backends. diff --git a/bacula-checkconf b/bacula-checkconf deleted file mode 100644 index da3bb25..0000000 --- a/bacula-checkconf +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# Check if we still have our @@PLACEHOLDERS@@ in the config. -# If yes, refuse to start, the user has never touched the config. - -if [ $# -ne 1 ]; then - echo "Usage: $0 [configfile]" - exit 1 -fi -grep -q '^[^#].*_PASSWORD@@' $1 -if [ $? -eq 0 ]; then - logger -st bacula-dir "Error: placeholder password in config file $1" - exit 6 -fi - -exit 0 - diff --git a/bacula-dir.init b/bacula-dir.init index 4a802fb..b5fa74a 100644 --- a/bacula-dir.init +++ b/bacula-dir.init @@ -42,7 +42,6 @@ start() { [ -x $exec ] || exit 5 [ -f $config ] || exit 6 echo -n $"Starting $prog: " - bacula-checkconf $CONFIG daemon $prog $OPTS retval=$? echo diff --git a/bacula-dir.service b/bacula-dir.service index 0962a48..1dafbcf 100644 --- a/bacula-dir.service +++ b/bacula-dir.service @@ -7,7 +7,6 @@ After=network.target nss-lookup.target [Service] Environment=CONFIG=/etc/bacula/bacula-dir.conf EnvironmentFile=-/etc/sysconfig/bacula-dir -ExecStartPre=/usr/sbin/bacula-checkconf $CONFIG ExecStart=/usr/sbin/bacula-dir -f $OPTS -c $CONFIG -u $DIR_USER -g $DIR_GROUP StandardOutput=syslog Restart=always diff --git a/bacula-fd.init b/bacula-fd.init index e61ab41..0c1b503 100644 --- a/bacula-fd.init +++ b/bacula-fd.init @@ -40,7 +40,6 @@ start() { [ -x $exec ] || exit 5 [ -f $config ] || exit 6 echo -n $"Starting $prog: " - bacula-checkconf $CONFIG daemon $prog $OPTS retval=$? echo diff --git a/bacula-fd.service b/bacula-fd.service index 3e2f7a1..ab00ce1 100644 --- a/bacula-fd.service +++ b/bacula-fd.service @@ -7,7 +7,6 @@ After=network.target nss-lookup.target [Service] Environment=CONFIG=/etc/bacula/bacula-fd.conf EnvironmentFile=-/etc/sysconfig/bacula-fd -ExecStartPre=/usr/sbin/bacula-checkconf $CONFIG ExecStart=/usr/sbin/bacula-fd -f $OPTS -c $CONFIG -u $FD_USER -g $FD_GROUP IOSchedulingClass=idle StandardOutput=syslog diff --git a/bacula-sd.init b/bacula-sd.init index 8222f88..409bc32 100644 --- a/bacula-sd.init +++ b/bacula-sd.init @@ -42,7 +42,6 @@ start() { [ -x $exec ] || exit 5 [ -f $config ] || exit 6 echo -n $"Starting $prog: " - bacula-checkconf $CONFIG daemon $prog $OPTS retval=$? echo diff --git a/bacula-sd.service b/bacula-sd.service index 6350fcd..01fcabb 100644 --- a/bacula-sd.service +++ b/bacula-sd.service @@ -7,7 +7,6 @@ After=network.target nss-lookup.target [Service] Environment=CONFIG=/etc/bacula/bacula-sd.conf EnvironmentFile=-/etc/sysconfig/bacula-sd -ExecStartPre=/usr/sbin/bacula-checkconf $CONFIG ExecStart=/usr/sbin/bacula-sd -f $OPTS -c $CONFIG -u $SD_USER -g $SD_GROUP StandardOutput=syslog Restart=always diff --git a/bacula.spec b/bacula.spec index d5afa0a..7d54992 100644 --- a/bacula.spec +++ b/bacula.spec @@ -3,7 +3,7 @@ Name: bacula Version: 5.2.13 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Cross platform network backup for Linux, Unix, Mac and Windows # See LICENSE for details License: AGPLv3 with exceptions @@ -26,7 +26,6 @@ Source15: bacula-fd.sysconfig Source16: bacula-dir.sysconfig Source17: bacula-sd.sysconfig Source18: bacula-sd.sysconfig.el5 -Source19: bacula-checkconf Patch1: bacula-5.0.2-openssl.patch Patch2: bacula-5.2.2-queryfile.patch @@ -427,7 +426,6 @@ install -p -m 755 -D scripts/logwatch/applybaculadate %{buildroot}%{_sysconfdir} install -p -m 644 -D scripts/logwatch/logfile.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/logfiles/bacula.conf install -p -m 644 -D scripts/logwatch/services.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/services/bacula.conf -install -p -m 755 -D %{SOURCE19} %{buildroot}%{_sbindir}/bacula-checkconf %if 0%{?fedora} || 0%{?rhel} >= 7 # Systemd unit files mkdir -p %{buildroot}%{_unitdir} @@ -764,7 +762,6 @@ fi %{_mandir}/man8/btraceback.8.* %dir %attr(750, bacula, bacula) %{_localstatedir}/log/bacula %dir %attr(750, bacula, bacula) %{_localstatedir}/spool/bacula -%{_sbindir}/bacula-checkconf %files director %defattr(-,root,root,-) @@ -906,6 +903,10 @@ fi %changelog +* Thu Feb 21 2013 Simone Caronni - 5.2.13-2 +- Removed bacula-checkconf stuff. +- Updataed README with sqlite3 and mysql how to. + * Wed Feb 20 2013 Simone Caronni - 5.2.13-1 - Update to 5.2.13, drop upstreamed patch. - Remove Fedora 16 (EOL) checks. diff --git a/quickstart_mysql.txt b/quickstart_mysql.txt new file mode 100644 index 0000000..2118632 --- /dev/null +++ b/quickstart_mysql.txt @@ -0,0 +1,59 @@ +======== Quick installation guide with the MySQL backend ======== + +Perform the following commands to install Bacula with its default configuration +and all daemons and consoles in one server. + +1) Install packages + +# yum -y install mysql-server \ + bacula-director bacula-storage bacula-client \ + bacula-console bacula-console-bat + +2) Select the MySQL database backend + +# alternatives --set libbaccats.so /usr/lib64/libbaccats-mysql.so + +3) Create database + +# systemctl enable mysqld.service +# systemctl start mysqld.service + +# cd /usr/libexec/bacula +# ./create_bacula_database mysql +# ./make_bacula_tables mysql +# ./grant_bacula_privileges mysql + +4) Change passwords in /etc/bacula/*conf with something you like. + +# sed -i -e 's/@@DIR_PASSWORD@@/dir-Fedora/g' \ + -e 's/@@FD_PASSWORD@@/fd-Fedora/g' \ + -e 's/@@SD_PASSWORD@@/sd-Fedora/g' \ + -e 's/@@MON_DIR_PASSWORD@@/mon-dir-Fedora/g' \ + -e 's/@@MON_FD_PASSWORD@@/mon-fd-Fedora/g' \ + -e 's/@@MON_SD_PASSWORD@@/mon-sd-Fedora/g' \ + /etc/bacula/*conf + +5) Enable daemons and check they are working + +# systemctl enable bacula-dir.service +# systemctl enable bacula-sd.service +# systemctl enable bacula-fd.service + +# systemctl start bacula-dir.service +# echo status bacula-dir | bconsole + +# systemctl start bacula-sd.service +# echo status bacula-sd | bconsole + +# systemctl start bacula-fd.service +# echo status bacula-fd | bconsole + +6) Install the docs and read them + +# yum -y install bacula-docs + +7) If you don't backup to disk and have a tape library or autochanger, please +also install the magnetic tapes commands: + +# yum -y install mt-st mtx + diff --git a/quickstart_postgresql.txt b/quickstart_postgresql.txt new file mode 100644 index 0000000..4c0afae --- /dev/null +++ b/quickstart_postgresql.txt @@ -0,0 +1,61 @@ +======== Quick installation guide with the default PostgreSQL backend ======== + +Perform the following commands to install Bacula with its default configuration +and all daemons and consoles in one server. + +1) Install packages + +# yum -y install postgresql-server \ + bacula-director bacula-storage bacula-client \ + bacula-console bacula-console-bat + +2) Select the PostgreSQL database backend + +# alternatives --set libbaccats.so /usr/lib64/libbaccats-postgresql.so + +3) Create database + +# postgresql-setup initdb +# systemctl enable postgresql.service +# systemctl start postgresql.service + +# su - postgres +$ cd /usr/libexec/bacula +$ ./create_bacula_database +$ ./make_bacula_tables +$ ./grant_bacula_privileges + +4) Change passwords in /etc/bacula/*conf with something you like. + +# sed -i -e 's/@@DIR_PASSWORD@@/dir-Fedora/g' \ + -e 's/@@FD_PASSWORD@@/fd-Fedora/g' \ + -e 's/@@SD_PASSWORD@@/sd-Fedora/g' \ + -e 's/@@MON_DIR_PASSWORD@@/mon-dir-Fedora/g' \ + -e 's/@@MON_FD_PASSWORD@@/mon-fd-Fedora/g' \ + -e 's/@@MON_SD_PASSWORD@@/mon-sd-Fedora/g' \ + /etc/bacula/*conf + +5) Enable daemons and check they are working + +# systemctl enable bacula-dir.service +# systemctl enable bacula-sd.service +# systemctl enable bacula-fd.service + +# systemctl start bacula-dir.service +# echo status bacula-dir | bconsole + +# systemctl start bacula-sd.service +# echo status bacula-sd | bconsole + +# systemctl start bacula-fd.service +# echo status bacula-fd | bconsole + +6) Install the docs and read them + +# yum -y install bacula-docs + +7) If you don't backup to disk and have a tape library or autochanger, please +also install the magnetic tapes commands: + +# yum -y install mt-st mtx + diff --git a/quickstart_sqlite3.txt b/quickstart_sqlite3.txt new file mode 100644 index 0000000..61f2b27 --- /dev/null +++ b/quickstart_sqlite3.txt @@ -0,0 +1,56 @@ +======== Quick installation guide with the SQLite backend ======== + +Perform the following commands to install Bacula with its default configuration +and all daemons and consoles in one server. + +1) Install packages + +# yum -y install sqlite \ + bacula-director bacula-storage bacula-client \ + bacula-console bacula-console-bat + +2) Select the SQLite database backend + +# alternatives --set libbaccats.so /usr/lib64/libbaccats-sqlite3.so + +3) Create database + +# cd /usr/libexec/bacula +# ./create_bacula_database sqlite3 +# ./make_bacula_tables sqlite3 +# ./grant_bacula_privileges sqlite3 + +4) Change passwords in /etc/bacula/*conf with something you like. + +# sed -i -e 's/@@DIR_PASSWORD@@/dir-Fedora/g' \ + -e 's/@@FD_PASSWORD@@/fd-Fedora/g' \ + -e 's/@@SD_PASSWORD@@/sd-Fedora/g' \ + -e 's/@@MON_DIR_PASSWORD@@/mon-dir-Fedora/g' \ + -e 's/@@MON_FD_PASSWORD@@/mon-fd-Fedora/g' \ + -e 's/@@MON_SD_PASSWORD@@/mon-sd-Fedora/g' \ + /etc/bacula/*conf + +5) Enable daemons and check they are working + +# systemctl enable bacula-dir.service +# systemctl enable bacula-sd.service +# systemctl enable bacula-fd.service + +# systemctl start bacula-dir.service +# echo status bacula-dir | bconsole + +# systemctl start bacula-sd.service +# echo status bacula-sd | bconsole + +# systemctl start bacula-fd.service +# echo status bacula-fd | bconsole + +6) Install the docs and read them + +# yum -y install bacula-docs + +7) If you don't backup to disk and have a tape library or autochanger, please +also install the magnetic tapes commands: + +# yum -y install mt-st mtx + From 2e1584db9032fcaf2c00afd930a75acea980ab64 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Thu, 21 Feb 2013 17:34:40 +0100 Subject: [PATCH 2/2] Add new docs to package --- README.Fedora => README | 0 bacula.spec | 15 +++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) rename README.Fedora => README (100%) diff --git a/README.Fedora b/README similarity index 100% rename from README.Fedora rename to README diff --git a/bacula.spec b/bacula.spec index 7d54992..aaecf89 100644 --- a/bacula.spec +++ b/bacula.spec @@ -12,7 +12,11 @@ URL: http://www.bacula.org BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Source0: http://www.bacula.org/downloads/Bacula-%{version}/%{name}-%{version}.tar.gz -Source5: README.Fedora + +Source2: quickstart_postgresql.txt +Source3: quickstart_mysql.txt +Source4: quickstart_sqlite3.txt +Source5: README Source6: bacula.logrotate Source7: bacula-fd.init Source8: bacula-dir.init @@ -316,6 +320,7 @@ Provides check_bacula support for Nagios. %patch3 -p0 -b .priv %patch4 -p1 -b .bat-build %patch5 -p1 -b .seg-fault +cp %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} . # Remove execution permissions from files we're packaging as docs later on find updatedb -type f | xargs chmod -x @@ -385,8 +390,6 @@ pushd src/qt-console/tray-monitor popd %endif -cp %{SOURCE5} . - %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} @@ -749,8 +752,8 @@ fi %files common %defattr(-,root,root,-) -%doc AUTHORS ChangeLog LICENSE SUPPORT ReleaseNotes -%doc README.Fedora +%doc AUTHORS ChangeLog LICENSE SUPPORT +%doc README quickstart_* %config(noreplace) %{_sysconfdir}/logrotate.d/bacula %dir %{_sysconfdir}/%{name} %dir %{_libexecdir}/%{name} @@ -905,7 +908,7 @@ fi %changelog * Thu Feb 21 2013 Simone Caronni - 5.2.13-2 - Removed bacula-checkconf stuff. -- Updataed README with sqlite3 and mysql how to. +- Separated postgresql, sqlite3 and mysql how to from README. * Wed Feb 20 2013 Simone Caronni - 5.2.13-1 - Update to 5.2.13, drop upstreamed patch.