BackupPC on Ubuntu 12.04

I recently upgraded my home server from Ubuntu 10.10 maverick to 12.04 precise. I ran “do-release-upgrade” three times, upgrading through natty and oneiric. The process was very smooth, but I found a few bugs with BackupPC. If you are using BackupPC 3.2.1 on precise, or plan to upgrade soon, I suggest you read the following.

1. $Conf{Ping6Path} is not set

This was a surprise to me, as I use IPv4 for running backups. Since natty, not setting $Conf{Ping6Path} causes BackupPC to report “no ping response” for most hosts. Strangely, this error is irregular. Pings to some hosts always succeed, while others only succeed sometimes. No hosts consistently failed.

The solution is easy. Set this in /etc/backuppc/config:

$Conf{Ping6Path} = '/bin/ping6';

2. Use of qw(…) as parentheses is deprecated

Since Perl 5.14 in Ubuntu 11.10 oneiric, BackupPC reports these errors at startup, in logs, and during command-line operations:

Use of qw(...) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Storage/Text.pm line 302.
Use of qw(...) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Lib.pm line 1425.

To resolve this, download this patch, and apply it. Here is a handy one-liner which will fail safely if anything goes wrong:

wget -q http://www.tolaris.com/blog/wp-content/uploads/2012/05/BackupPC-3.2.1-CVE-2011-170886.diff -O- | patch -p0 -N -r - -d /usr/share/backuppc/

3. BackupPC displays bogus “Last email sent” messages

BackupPC will send error message emails to the administrator or user of a host (backup target) if it cannot reach the host for a set period of time. The user interface always displays this last message, even if it doesn’t exist:

Last email sent to user@example.com was at 2012-05-01 01:23, subject “”.

Last year I wrote a patch to resolve this. If no email has ever been sent (last email subject is undefined), it simply doesn’t output the “Last email sent” line. My patch has never made it upstream, so I patch it manually after upgrades.

To resolve this, download this patch, and apply it.

wget -q http://www.tolaris.com/blog/wp-content/uploads/2012/05/BackupPC-3.2.1-no_blank_email.diff -O- | patch -p0 -N -r - -d /usr/share/backuppc/

Apply both patches with:

wget -q http://www.tolaris.com/blog/wp-content/uploads/2012/05/BackupPC-3.2.1-CVE-2011-170886.diff http://www.tolaris.com/blog/wp-content/uploads/2012/05/BackupPC-3.2.1-no_blank_email.diff -O- | patch -p0 -N -r - -d /usr/share/backuppc/

Tags: , ,

  1. Jason Greene’s avatar

    Hi. Thanks for the info. I tried your patch to resolve the Use of qw(…) as parentheses is deprecated, but i get the following error:

    Hunk #1 succeeded at 300 (offset 1 line).
    patch: **** Can’t rename file lib/BackupPC/Storage/Text.pm to lib/BackupPC/Storage/Text.pm.orig : Permission denied

    I used sudo so I’m not sure what went wrong?

    Any help is appreciated.

    Reply

    1. Jason Greene’s avatar

      Solved:
      logged in as root using sudo -i and ran it again. worked!

      Reply

      1. Tyler Wagner’s avatar

        sudo is tricky with pipes (|) and redirects (> and <). You must use sudo after each pipe (actually before each command that needs root permissions), and you cannot use redirects at all (they will run as your user). The wget commands don't need sudo. The patch commands do.

        Reply

      2. Mike Lerley’s avatar

        I’ve just discovered that I have this problem: http://www.mail-archive.com/backuppc-users@lists.sourceforge.net/msg23798.html

        Any suggestions? I don’t see an easy way to downgrade Samba to a useful version in Precise. Maybe there’s a simple patch for backuppc that could fix the returned error issue?

        Reply

        1. Tyler Wagner’s avatar

          I’m not using Samba for backup on my 12.04 server at present, but I’ll need this too.

          In the mean time, the easy solution is to (untested, please let me know):

          1. Add the oneiric repos to your precise server
          2. apt-get install smbclient=2:3.5.11~dfsg-1ubuntu2.3
          3. echo “smbclient hold” | dpkg –set-selections

          If you confirm that this works, and give me the apt-get output (so I can get the downloaded package list), I’ll import these packages to my repository for precise for everyone else.

          Reply

          1. Mike Lerley’s avatar

            OK. I had to remove winbind (not using it anyway) and I ended up with the following downgrades:

            Setting up libwbclient0 (2:3.5.11~dfsg-1ubuntu2.3) …
            Setting up samba-common (2:3.5.11~dfsg-1ubuntu2.3) …
            Setting up winbind (2:3.5.11~dfsg-1ubuntu2.3) …
            Setting up samba-common-bin (2:3.5.11~dfsg-1ubuntu2.3) …
            Setting up libpam-smbpass (2:3.5.11~dfsg-1ubuntu2.3) …
            Setting up smbclient (2:3.5.11~dfsg-1ubuntu2.3) …

            HOWEVER, not much works — running smbclient gives me

            smbclient: relocation error: smbclient: symbol krb5_locate_kdc, version krb5_3_MIT not defined in file libkrb5.so.3 with link time reference

            Downgrading libkrb widens and deepens the rabbit hole to a place where it seems to be a very, very bad idea. I’m going to try building the previous version from source and see what happens. Ugh.

            I wonder if samba 4 has the same issue? Or other, worse ones?

            Reply

            1. Tyler Wagner’s avatar

              That is a link issue against the older libraries.

              I’ve build Samba from oneiric against libraries in precise using pbuilder (see elsewhere in my blog), and uploaded the packages to my precise repository. Try:

              1. Add my precise repo to your precise server
              2. apt-get install smbclient=2:3.5.11~dfsg-1ubuntu2.3
              3. echo “smbclient hold” | dpkg –set-selections

              I am uploading amd64 now. i386 packages will be ready and uploaded in about an hour.

              Reply

              1. Mike Lerley’s avatar

                I managed to compile 3.5.11 and get it running alongside the broken packages. It would make a package purist cry but coming from a long history of Slackware I’ll put up with it until it gets fixed. Running a backup atm; I’ll try again with your packages in a while. Thanks!

                Reply

                1. Tyler Wagner’s avatar

                  OK, thanks. Total package list imported into repo:

                  libpam-smbpass_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  libpam-smbpass_3.5.11~dfsg-1ubuntu2.3_i386.deb
                  libsmbclient_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  libsmbclient_3.5.11~dfsg-1ubuntu2.3_i386.deb
                  libsmbclient-dev_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  libsmbclient-dev_3.5.11~dfsg-1ubuntu2.3_i386.deb
                  libwbclient0_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  libwbclient0_3.5.11~dfsg-1ubuntu2.3_i386.deb
                  libwbclient-dev_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  libwbclient-dev_3.5.11~dfsg-1ubuntu2.3_i386.deb
                  samba_3.5.11~dfsg-1ubuntu2.3_amd64.changes
                  samba_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  samba_3.5.11~dfsg-1ubuntu2.3.debian.tar.gz
                  samba_3.5.11~dfsg-1ubuntu2.3.dsc
                  samba_3.5.11~dfsg-1ubuntu2.3_i386.changes
                  samba_3.5.11~dfsg-1ubuntu2.3_i386.deb
                  samba_3.5.11~dfsg.orig.tar.bz2
                  samba-common_3.5.11~dfsg-1ubuntu2.3_all.deb
                  samba-common-bin_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  samba-common-bin_3.5.11~dfsg-1ubuntu2.3_i386.deb
                  samba-dbg_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  samba-dbg_3.5.11~dfsg-1ubuntu2.3_i386.deb
                  samba-doc_3.5.11~dfsg-1ubuntu2.3_all.deb
                  samba-doc-pdf_3.5.11~dfsg-1ubuntu2.3_all.deb
                  samba-tools_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  samba-tools_3.5.11~dfsg-1ubuntu2.3_i386.deb
                  smbclient_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  smbclient_3.5.11~dfsg-1ubuntu2.3_i386.deb
                  swat_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  swat_3.5.11~dfsg-1ubuntu2.3_i386.deb
                  winbind_3.5.11~dfsg-1ubuntu2.3_amd64.deb
                  winbind_3.5.11~dfsg-1ubuntu2.3_i386.deb

                  If your test results positive, I’ll make a new blog post about this for others to find.

                  Reply

                  1. Mike Lerley’s avatar

                    Had to uninstall a couple of interim things but reinstalling with all your packages seems to be working great! Thanks a lot.

                    Reply

                    1. Tyler Wagner’s avatar

                      Awesome, Mike. I’ll post about this shortly, and inform the list.

                      Reply

                    2. Sam Powis’s avatar

                      A bit late to the party, I know – but I just updated my fileserver to 12.04 and had the same library issues. Your package worked a treat, once I realised I had to apt-get update before it’d ‘see’ the packages in your repository :). Samba is now running again and I can access my shares. Thank you!

                      Reply

                    3. Jason Greene’s avatar

                      I never got it to work right. I gave up and went back to 10.04 LTS until I see a fix in the wild.

                      Reply

                    4. Claudio’s avatar

                      Thanks for sharing your patch, worked flawlessly (as root).

                      Reply

                    5. Jerry’s avatar

                      Worked great on a recently updated BackupPC on Ubuntu 10.04 -> 12.04.
                      Thanks for sharing Tyler!

                      Reply

                    6. TONY’s avatar

                      Thanks for sharing man solved my issues in seconds.

                      Reply

                    7. Alex’s avatar

                      Both patches worked well.

                      Reply

                    8. tellme’s avatar

                      Ubuntu 12.04
                      Backuppc 3.3.0

                      message:

                      root@backuppc:~# wget -q http://www.tolaris.com/blog/wp-content/uploads/2012/05/BackupPC-3.2.1-CVE-2011-170886.diff -O- | patch -p0 -N -r – -d /usr/share/backuppc/
                      -bash: patch: command not found

                      any options ?

                      Reply

                      1. Tyler Wagner’s avatar

                        apt-get install patch

                        Reply

                        1. tellme’s avatar

                          Hi Tyler, thanks for your input, i now have use this command, however i still get an error:

                          root@backuppc:~# sudo wget -q http://www.tolaris.com/blog/wp-content/uploads/2012/05/BackupPC-3.2.1-no_blank_email.diff -O- | apt-get install patch -p0 -N -r – -d /usr/share/backuppc/
                          E: Command line option ‘p’ [from -p0] is not known.
                          root@backuppc:~#

                          I use root login.
                          Any ideas what i do wrong ?

                          Thank u !

                          Reply

                          1. Tyler Wagner’s avatar

                            No, you need to install patch first:

                            apt-get install patch
                            wget -q http://www.tolaris.com/blog/wp-content/uploads/2012/05/BackupPC-3.2.1-CVE-2011-170886.diff -O- | patch -p0 -N -r – -d /usr/share/backuppc/

                            If this is your first time using Ubuntu, you’ll need to spend some time reading the basics of installing software. If this is your first time with BackupPC, you need to know how permissions work in Linux, and what filesystem hardlinks are.

                            Reply

                          2. tellme’s avatar

                            ooooooo , ok, thanks for explaining, i have never heard or used an installable package named ‘patch’ in ubuntu.
                            Clear now, go and give it a try again….thank you !!

                            Reply

                            1. tellme’s avatar

                              Thanks Tyler, all went without a scratch :-) Both patches. Hope the error and email message are not an issue anymore.
                              thank you.

                              Regards Tellme.

                              Reply

                              1. Tyler Wagner’s avatar

                                Glad I could help. “patch” is a standard tool for applying changes to source code. Consider installing the standard tools for future use:

                                apt-get install build-essential

                                Reply

                                1. tellme’s avatar

                                  Many Thanks Tyler for reply patience and knowledge, I will install these tools now as a standard when installing a new linux server !!! Tnaks for the patches, they works !

                                  Best regards
                                  Tellme

                                  Reply

Reply to Anonymous Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.