Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 141018 - app-backup/backuppc-3.0.0 version bump
Summary: app-backup/backuppc-3.0.0 version bump
Status: RESOLVED DUPLICATE of bug 287133
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High enhancement with 2 votes (vote)
Assignee: App-Backup Team
URL: http://backuppc.sourceforge.net/
Whiteboard:
Keywords:
: 164415 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-19 03:26 UTC by Hod
Modified: 2009-09-30 21:46 UTC (History)
18 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
An almost working ebuild with two patches. (backuppc.tar.bz2,2.91 KB, application/octet-stream)
2007-05-23 12:30 UTC, Randy Barlow
Details
script to set permissions after ebuild (install-300.sh,1.30 KB, text/plain)
2007-05-23 22:02 UTC, David Relson
Details
ebuild for BackupPC-3.0.0 (backuppc.tar.bz2,3.54 KB, application/octet-stream)
2007-05-23 23:44 UTC, Randy Barlow
Details
ebuild for BackupPC-3.0.0 (backuppc.tar.bz2,2.82 KB, application/octet-stream)
2007-05-24 05:16 UTC, Randy Barlow
Details
A proposed backuppc ebuild. (backuppc-3.0.0.ebuild,3.48 KB, text/plain)
2007-06-14 06:27 UTC, Randy Barlow
Details
An http password file (authUser,23 bytes, text/plain)
2007-06-14 06:29 UTC, Randy Barlow
Details
A conf.d file for a separate instance of Apache for BackupPC's web interface (backuppcApache2.conf,1.97 KB, text/plain)
2007-06-14 06:30 UTC, Randy Barlow
Details
An init.d script for a separate instance of Apache for BackupPC's web interface (backuppcApache2.init,2.54 KB, text/plain)
2007-06-14 06:31 UTC, Randy Barlow
Details
The configuration file for the separate instance of Apache for the BackupPC web interface (httpd.conf,37.51 KB, text/plain)
2007-06-14 06:31 UTC, Randy Barlow
Details
A patch to fix the location of the perl interpreter used by the install script (perlInterpreter.patch,303 bytes, patch)
2007-06-14 06:32 UTC, Randy Barlow
Details | Diff
Instructions to the user after the install (postinstall-en.txt,724 bytes, text/plain)
2007-06-14 06:33 UTC, Randy Barlow
Details
An ebuild which dosnt require a seperate instance of apache running (backuppc-3.0.0.ebuild,4.31 KB, text/plain)
2007-06-14 23:22 UTC, Thomas Bird
Details
New ebuild for backuppc on a single instance of apache (backuppc-3.0.0-r1.ebuild,4.00 KB, text/plain)
2007-06-19 00:33 UTC, Thomas Bird
Details
A webapp hook to change the premissions of of the backuppc files (fixperms,348 bytes, text/plain)
2007-06-19 00:37 UTC, Thomas Bird
Details
.htaccess file for the backuppc directory (.htaccess,287 bytes, text/plain)
2007-06-19 00:40 UTC, Thomas Bird
Details
Updated ebuild (backuppc-3.0.0-r1.ebuild,4.18 KB, text/plain)
2007-07-06 00:02 UTC, Thomas Bird
Details
New postinstall-en.txt (postinstall-en.txt,522 bytes, text/plain)
2007-07-06 00:04 UTC, Thomas Bird
Details
New backuppc ebuild (backuppc-3.0.0-r1.ebuild,4.23 KB, text/plain)
2007-08-16 22:07 UTC, Thomas Bird
Details
New postinstall-en.txt (postinstall-en.txt,764 bytes, text/plain)
2007-08-16 22:08 UTC, Thomas Bird
Details
New .htaccess (.htaccess,346 bytes, text/plain)
2007-08-16 22:12 UTC, Thomas Bird
Details
Updated files/postinstall-en.txt (postinstall-en.txt,932 bytes, text/plain)
2007-08-20 12:53 UTC, Thomas Bird
Details
app-backup/backuppc-3.1.0 (backuppc-3.1.0.ebuild,3.98 KB, text/plain)
2008-08-02 21:53 UTC, Christoph Brill (egore) (RESIGNED)
Details
Minor but necessary correction on rdepend (backuppc-3.1.0.ebuild,3.98 KB, text/plain)
2009-03-15 22:40 UTC, Philippe PUJAS
Details
New ebuild takes care of upgrading (backuppc-3.1.0.ebuild,6.21 KB, text/plain)
2009-06-10 04:40 UTC, Till Korten
Details
httpd.conf for the backuppc-apache instance (httpd.conf,11.83 KB, text/plain)
2009-06-10 04:44 UTC, Till Korten
Details
apache config file for the apache instance (apache2-backuppc.conf,2.99 KB, text/plain)
2009-06-10 04:44 UTC, Till Korten
Details
init script for the apache instance (apache2-backuppc.init,3.71 KB, text/plain)
2009-06-10 04:46 UTC, Till Korten
Details
an updated postinstall.txt (postinstall-en.txt,854 bytes, text/plain)
2009-06-10 04:47 UTC, Till Korten
Details
updated ebuild that requires perl-core/IO-Compress which replaces perl-core/Compress-Zlib (backuppc-3.1.0.ebuild,6.35 KB, text/plain)
2009-06-23 11:44 UTC, Till Korten
Details
fixed a minor bug. (backuppc-3.1.0.ebuild,6.37 KB, text/plain)
2009-06-23 11:48 UTC, Till Korten
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hod 2006-07-19 03:26:38 UTC
BackupPC 3.0.0beta0 released on July 11th, 2006
Comment 1 Janne Pikkarainen 2006-08-16 08:08:42 UTC
... and BackupPC 3.0.0beta1 released on July 30th, 2006.
Comment 2 Janne Pikkarainen 2006-11-25 10:52:13 UTC
... and BackupPC 3.0.0beta2 released on November 18th, 2006
Comment 3 Harold Anderson 2007-01-20 20:53:12 UTC
And BackupPC 3.0.0beta3 released also
Comment 4 Janne Pikkarainen 2007-01-29 07:30:35 UTC
And BackupPC 3.0 final was also released on January 29th, 2007.
Comment 5 Randy Barlow 2007-01-29 16:13:08 UTC
I opened a bug as an ebuild request for 3.0.0 http://bugs.gentoo.org/show_bug.cgi?id=164415
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2007-01-29 18:49:00 UTC
*** Bug 164415 has been marked as a duplicate of this bug. ***
Comment 7 Randy Barlow 2007-05-23 11:14:17 UTC
I have been working this morning on an ebuild for BackupPC-3.0.0 and it is very close to working.  However, I am not a Gentoo-dev (this is my second e-build ever, and way more complicated than the last!) and so I'm sure there will be many things that need fixing.  For one, I am requiring net-www/apache as opposed to some virtual similar to virtuals/mta (is there a virtuals/webServer or some such?).

Another problem I perceive with BackupPC is what about upgrades?  Typically, if one is upgrading BackupPC, you would tell the script the location of the current config.pl and it will do the rest for you.  How do you know in an ebuild if this is an upgrade or a new install, and how do you take appropriate action?
Comment 8 Randy Barlow 2007-05-23 12:30:25 UTC
Created attachment 120083 [details]
An almost working ebuild with two patches.

The ebuild in this archive almost works correctly.  Something is still wrong in the configs or the init script, or possibly in backuppc itself (am working with the backuppc mailing list on it!).  When you call /etc/init.d/backuppc start, you will see:

 * Starting BackupPC ...
No language setting
BackupPC::Lib->new failed                                                 [ !! ]

This is an issue that another packager for BSD seems to have run into in the past week or two, and so we may be able to work together...
Comment 9 David Relson 2007-05-23 22:01:06 UTC
A quick web search gives the following possible answer:

http://backuppc.sourceforge.net/faq/debugCGI.html#i_get_the_error_error__unable_to_read_config_pl_or_language_strings____how_do_i_fix_this

My recollection from installing 3.0.0 is that file permissions _are_ likely to cause a problem.

I've got an install script that encapsulates what I learned while tweaking my install til it worked.  I'll upload it in a moment.
Comment 10 David Relson 2007-05-23 22:02:15 UTC
Created attachment 120140 [details]
script to set permissions after ebuild
Comment 11 Randy Barlow 2007-05-23 23:44:17 UTC
Created attachment 120152 [details]
ebuild for BackupPC-3.0.0

This ebuild seems to work properly, though I do have some testing to do.  I would appreciate any criticisms of my ebuild writing form too as I am new to this!  Many thanks to Relson for his help!
Comment 12 David Relson 2007-05-24 02:18:17 UTC
Randy,

A couple of questions on your ebuild:

src_install() has:
	dodir /etc/backuppc

pkg_postinst() has:
	chown -Rf backuppc:backuppc "${ROOT}/etc/BackupPC"

Why $(ROOT) is one but not the other?  

Why capital letters in one bug not the other?  If I recall, backuppc-2.x.y defaults to /etc/backuppc and backuppc-3.0.0 defaults to /etc/BackupPC.  For updating from 2 to 3, /etc/backuppc is proper and for a new install /etc/BackupPC is proper.

Also src_install() references ${myconf} which appears not to be defined.  Can the "$(myconf) || die" be on a separate line from ./configure.pl ???
Comment 13 Randy Barlow 2007-05-24 05:16:15 UTC
Created attachment 120166 [details]
ebuild for BackupPC-3.0.0

Mr. Relson, thanks for your comments!  I fixed the descrepencies with /etc/backuppc and ${ROOT}/etc/BackupPC, making them both ${ROOT}/etc/BackupPC.  As for the problem of BackupPC 2.x.y using /etc/backuppc and newer versions using /etc/BackupPC, I'm not sure how to handle that.  Is there a test in an ebuild for whether someone is upgrading or not?  Can we just not worry about it since 2.x.y never went stable in portage anyway?  Another solution is to have BackupPC use /etc/backuppc always, but due to a bug in the configure.pl script this will require patchine the Lib.pm file - not impossible, but just seems like not the optimal route for us to go.  Your thoughts?

I defined myconf for sure now, and made it so it is not on a separate line from the ./configure.pl; let me know what you think!
Comment 14 Randy Barlow 2007-05-24 05:44:43 UTC
Another thought: In order to use the web interface for backuppc, the user will have to do a lot of additional setup work.  I personally use a separate instance of apache running on a different port to handle backuppc, just because that makes it easier to have apache running as user backuppc.  What I did was to make new init.d and conf.d scripts, as well as another httpd.conf for backuppc.  I also setup some htaccess stuff for authentication.  How much of this should be left to the user and how much should be done by the ebuild maintainer?  Is what the ebuild I've submitted so far does enough?  I personally wouldn't mind it adding these additional scripts as a user, because it's less for the user to figure out.  We could set up everything and then tell the user to edit the htaccess password file and start the backuppcApache service (or whatever we want to call it) and then they would be on their merry way.  Thoughts?
Comment 15 David Relson 2007-05-24 11:19:26 UTC
My recollection is that the configure script determines if it's an upgrade or a new installation, hence doesn't need to be told /etc/backuppc or /etc/BackupPC.  However, since the ebuild refers to /etc/..., the ebuild needs to test, i.e.

  if [ -d $(ROOT)/etc/backuppc ] ; then
     # update
     ETC="$(ROOT)/etc/backuppc"
  else
     # install
     ETC="$(ROOT)/etc/BackupPC"
  fi

Automatically configuring the web interface would be a good thing.  The web interface is a major feature and is needed (at least for restoring files).  As the process is also detail oriented it can be difficult for someone unfamiliar with BackupPC and apache.

I should be able to some testing of the ebuild this evening.
Comment 16 Jakub Moc (RETIRED) gentoo-dev 2007-05-24 18:53:45 UTC
(In reply to comment #12)
> src_install() has:
>         dodir /etc/backuppc
> 
> pkg_postinst() has:
>         chown -Rf backuppc:backuppc "${ROOT}/etc/BackupPC"
> 
> Why $(ROOT) is one but not the other?  

Because you are not supposed to use ${ROOT} in src_* functions; so that was entirely correct. 

P.S. Please, don't attach tarballs w/ ebuilds, ever.

http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=2&chap=3#doc_chap2
Comment 17 Randy Barlow 2007-06-14 06:26:57 UTC
Alright, after some time I think I have a decent working ebuild.  I am sure though that there are things that should be fixed to be more "Gentooized".  There isn't a good way to make it totally "install and use" without the user having to do some configuration, but this is a pretty good shot at it I think.  I have several files that go along with the ebuild for the "files" folder too.  So here come a bunch of attachments (not in a tarball!)
Comment 18 Randy Barlow 2007-06-14 06:27:46 UTC
Created attachment 121984 [details]
A proposed backuppc ebuild.
Comment 19 Randy Barlow 2007-06-14 06:29:46 UTC
Created attachment 121986 [details]
An http password file

This files allows the default username of backuppc and password of backuppc to be used to log in to the web interface.  Of course, the user can change these passwords after installation, as explained in the postinstall-en.txt.
Comment 20 Randy Barlow 2007-06-14 06:30:29 UTC
Created attachment 121988 [details]
A conf.d file for a separate instance of Apache for BackupPC's web interface
Comment 21 Randy Barlow 2007-06-14 06:31:05 UTC
Created attachment 121989 [details]
An init.d script for a separate instance of Apache for BackupPC's web interface
Comment 22 Randy Barlow 2007-06-14 06:31:54 UTC
Created attachment 121990 [details]
The configuration file for the separate instance of Apache for the BackupPC web interface
Comment 23 Randy Barlow 2007-06-14 06:32:35 UTC
Created attachment 121991 [details, diff]
A patch to fix the location of the perl interpreter used by the install script
Comment 24 Randy Barlow 2007-06-14 06:33:00 UTC
Created attachment 121992 [details]
Instructions to the user after the install
Comment 25 Thomas Bird 2007-06-14 23:22:04 UTC
Created attachment 122086 [details]
An ebuild which dosnt require a seperate instance of apache running

Ive written another ebuild that seems to be working nicely for me, which uses the method described here http://gentoo-wiki.com/BackupPC to run the cgi interface on the normal apache server. Its based off the ebuild from a few weeks ago, as i didn't see the new one until just now.
Comment 26 Randy Barlow 2007-06-15 19:48:40 UTC
Thomas, a solution using a single instance of Apache would certainly be quite elegant, but the wiki page you referenced still proposed using a separate instance of Apache, and I didn't catch how your ebuild does it with just one (though I admittedly only browsed through it quickly).  Does your ebuild automatically set up basic authentication as well so that not just anybody can log on to the backuppc server web interface?  If not, perhaps we can combine forces to make a nice ebuild that uses a single instance of apache while also offering basic authentication.

Also, my ebuild puts the backuppc data into a new directory, /data/BackupPC, which admittedly is for my own purposes.  Is the proper "Gentoo" way of doing it to put it under /var/lib/backuppc?  Thanks for submitting your ebuild!
Comment 27 Thomas Bird 2007-06-16 10:43:30 UTC
It compiles a little c program which is run by apache as root with the suid bit. The program will then change to the backuppc user and run the cgi perl script.

My ebuild does not do authentication. Lets combine, if you want I'll take a look at your new one and merge it with mine.

As to where to put the data... No idea, but I don't really like the sound of /var/lib/backuppc as it's not really the first place I'd think to look for it. But I definitely don't like the idea of creating new folders in /. Also generally the folders in my /var/lib don't exceed a few MB, is it going to be a good idea to put several GB in there?

And thanks for submitting your ebuild ;-)
Comment 28 Thomas Bird 2007-06-19 00:33:36 UTC
Created attachment 122492 [details]
New ebuild for backuppc on a single instance of apache

So heres the new ebuild, I changed the way the permissions were handled and added a .htaccess (included in next post) for some security and some other stuff. I'm not sure if the .htaccess is working as my apache is a bit fubar atm, so could some one please test it.
Comment 29 Thomas Bird 2007-06-19 00:37:28 UTC
Created attachment 122493 [details]
A webapp hook to change the premissions of of the backuppc files

This is files/fixperms and just sets the suid bit on index.cgi and makes sure the files installed into htdocs have the right permissions.
Comment 30 Thomas Bird 2007-06-19 00:40:42 UTC
Created attachment 122494 [details]
.htaccess file for the backuppc directory

This is files/.htaccess I'm not sure if this is working or not so could someone please look at it, I think it should work but I don't like .htaccess files and they don't like me.
Comment 31 Warren Howard 2007-06-19 09:50:30 UTC
Hi,

Just a few comments on how I have BackupPC setup using the existing 2.1.2-r1 ebuild

* Apache (single instance) runs as 'apache' and BackupPC runs as 'backuppc'.  I use sudo to allow Apache to execute /usr/bin/BackupPC.  The relevant configs are :
  - from /etc/sudoers
    Defaults        !env_reset
    root    ALL=(ALL) ALL
    apache ALL = (backuppc) NOPASSWD: /var/www/localhost/cgi-bin/BackupPC_Admin
  
  - from /etc/apache2/vhosts.d//etc/apache2/vhosts.d/01_backuppc.conf
    ScriptAlias /BackupPC_Admin /etc/backuppc/backuppc_sudo_wrapper.pl
  
  - from /etc/backppc/backuppc_sudo_wrapper.pl
    #!/usr/bin/perl
    #
    exec '/usr/bin/sudo', '-u', 'backuppc', '/var/www/localhost/cgi-bin/BackupPC_Admin'

* I'm not too sure about the security merits of this setup up, all I can vouch for is that is works for me.  The idea/approach was adopted from the setup instructions for Sympa

* For authentication I point Apache to my ldap server
  - AuthLDAPURL ldaps://ldap.naturesoft.net/dc=naturesoft,dc=net?uid?sub?(objectClass=inetOrgPerson)

* Lastly I got caught out by these two bugs :
http://bugzilla.padl.com/show_bug.cgi?id=273
http://bugzilla.padl.com/show_bug.cgi?id=309

BackupPC would fail to fork because of a bug in nss_ldap (the server that BackupPC is on is configured with pam_ldap and nss_ldap).  My work around was to install stunnel and point /etc/ldap.conf to the unencrypted 127.0.0.1:389 connection.

Maybe some of this info is relevant to this ebuild.

Regards,


Warren.
Comment 32 Jean-Claude Repetto 2007-07-05 15:44:13 UTC
Thomas,

I have tested your ebuild (2007-06-19).
First, I think the line 47 is wrong. It should be :
                        if [ "$found" == "" ] ; then
and not
                        if [ "$found" != "" ] ; then
(Your ebuild never goes out of the while loop).

Then, I think there are permission problems, because /usr/local/BackupPC belongs to root.
When I start backuppc, I have an error :
# /etc/init.d/backuppc start
 * Starting BackupPC ...
Can't create LOG file /var/log/BackupPC/LOG at /usr/local/BackupPC/bin/BackupPC line 1792.

And I think the postinstall-en.txt file should be updated.

Thanks !



Comment 33 Jakub Moc (RETIRED) gentoo-dev 2007-07-05 15:49:14 UTC
(In reply to comment #32)
> Then, I think there are permission problems, because /usr/local/BackupPC
> belongs to root.

No ebuild should touch /usr/local.
Comment 34 Thomas Bird 2007-07-06 00:02:45 UTC
Created attachment 124020 [details]
Updated ebuild

The permissions on /var/log/BackupPC should now be correct, and I changed the if statement. The ebuild now installs into /usr/BackupPC, is this correct? Also I changed the data dir to /var/lib/BackupPC.
Comment 35 Thomas Bird 2007-07-06 00:04:15 UTC
Created attachment 124022 [details]
New postinstall-en.txt
Comment 36 Jean-Claude Repetto 2007-07-06 09:15:30 UTC
Hi,

Thanks ! Now backuppc is running, but not the CGI interface. Isn't mod_perl required ? Could you post an example of what you added in httpd.conf ?
Comment 37 Jean-Claude Repetto 2007-07-06 09:22:36 UTC
(In reply to comment #33)
> (In reply to comment #32)
> > Then, I think there are permission problems, because /usr/local/BackupPC
> > belongs to root.
> 
> No ebuild should touch /usr/local.
> 

You are right ! The problem was that the /var/log/BackupPC directory did not exist.
Comment 38 Thomas Bird 2007-07-06 16:30:41 UTC
(In reply to comment #37)
> You are right ! The problem was that the /var/log/BackupPC directory did not
> exist.

So is the backuppc cgi interface working for you now? As I understand it mod_perl shouldn't be needed as its a cgi script so it should fire up what ever is specified in the file, in this case /usr/bin/perl. If you are having problems with the cgi interface I suspect its the .htaccess file I'm not sure if it worked to begin with as I couldn't test it on my server, its a bit fubar. So could someone look at it please to if it works or not. Thanks.
Comment 39 saxjazman9 2007-08-03 18:25:19 UTC
so i'm trying to work out the kinks of this "perlInterpreter.patch"

 # emerge backuppc -vp

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] app-backup/backuppc-3.0.0  USE="doc samba vhosts" 0 kB [1] 

Total: 1 package (1 new), Size of downloads: 0 kB
Portage overlays:
 [1] /usr/local/portage
localhost work # emerge backuppc    
Calculating dependencies... done!
>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) app-backup/backuppc-3.0.0 to /
 * BackupPC-3.0.0.tar.gz MD5 ;-) ...                                                                                                                  [ ok ]
 * BackupPC-3.0.0.tar.gz RMD160 ;-) ...                                                                                                               [ ok ]
 * BackupPC-3.0.0.tar.gz SHA1 ;-) ...                                                                                                                 [ ok ]
 * BackupPC-3.0.0.tar.gz SHA256 ;-) ...                                                                                                               [ ok ]
 * BackupPC-3.0.0.tar.gz size ;-) ...                                                                                                                 [ ok ]
 * checking ebuild checksums ;-) ...                                                                                                                  [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                 [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                [ ok ]
 * checking BackupPC-3.0.0.tar.gz ;-) ...                                                                                                             [ ok ]
 * Using 102 as the UID for the backuppc user
>>> Unpacking source...
>>> Unpacking BackupPC-3.0.0.tar.gz to /var/tmp/portage/app-backup/backuppc-3.0.0/work
 * Applying perlInterpreter.patch ...

 * Failed Patch: perlInterpreter.patch !
 *  ( /usr/local/portage/app-backup/backuppc/files/perlInterpreter.patch )
 * 
 * Include in your bugreport the contents of:
 * 
 *   /var/tmp/portage/app-backup/backuppc-3.0.0/temp/perlInterpreter.patch-11221.out


!!! ERROR: app-backup/backuppc-3.0.0 failed.
Call stack:
  ebuild.sh, line 1621:   Called dyn_unpack
  ebuild.sh, line 753:   Called qa_call 'src_unpack'
  ebuild.sh, line 44:   Called src_unpack
  backuppc-3.0.0.ebuild, line 65:   Called epatch '/usr/local/portage/app-backup/backuppc/files/perlInterpreter.patch'
  eutils.eclass, line 304:   Called die

!!! Failed Patch: perlInterpreter.patch!
!!! If you need support, post the topmost build error, and the call stack if relevant.
!!! A complete build log is located at '/var/tmp/portage/app-backup/backuppc-3.0.0/temp/build.log'.

AND

PATCH COMMAND:   patch -p4 -g0 -E --no-backup-if-mismatch < /usr/local/portage/app-backup/backuppc/files/perlInterpreter.patch

=================================
missing header for unified diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- configure.pl.old   2007-05-23 06:35:26.000000000 -0500
|+++ configure.pl       2007-05-23 05:51:51.000000000 -0500
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored


I'm thinkin it *might* have something to do with the new capitilization of BackupPC (not backuppc) OR the fact that in the /work directory there is another sub of 'BackupPC' instead of the tar.gz dump.

I'm new'ish at ebuilds, still trying to hack out the details, just wanted to post this in-case someone else was seeing this and or working out a fix...
Comment 40 Randy Barlow 2007-08-03 18:31:00 UTC
perlInterpreter.patch was a quick patch I made to fix the installer scripts.  It was trying to use /bin/perl (doesn't exist in Gentoo) instead of /usr/bin/perl, so my patch just changed the first line from #!/bin/perl to #!/usr/bin/perl.  It may not work with ebuilds that others have submitted, but it does work with mine...
Comment 41 saxjazman9 2007-08-03 18:37:05 UTC
ahh, I didn't even see that the last two ebuilds were from diff authors... I'll check the differences between the two and see if I can update the last posted ebuild into working with this patch.
        
I do understand _what_ the patch is doing, i was about 10secs from just deleting it and ln -sf .... perl ;-)
        
figured i'd try to do it the right way for future use... 
        
thanks for the postback.
        
Comment 42 Marc Hulsman 2007-08-03 21:45:55 UTC
I have installed backuppc using the last submitted ebuild (thanks!). Some small problems i encountered:
- net-www/apache ebuild does not exist on my system, changed that dependency to www-servers/apache
- in the .htaccess file: <Files ... > does not support multiple arguments for apache 2.0  (I just changed that to two files blocks for both files, there is probably a better way)
- i had to make an authUser file, but placing it in /etc/BackupPc as suggested makes it unreadable for the apache server (world permissions on that dir are none). I placed them into another dir (/var/www/localhosts/passwords). 
- had to change the handler in the .htaccess file to .cgi instead of index.cgi to get it to execute the file
- something I didnt know (these ebuild and .htaccess files are somewhat new to me too): i had to set AllowOveride in /etc/apache/vhosts.d/00_default_vhost.conf to 'All' to get the .htaccess file to work ('All' is probably a bit overdone, but you get the idea). Maybe this should be included in the postinstall instructions.

the perlinterpreter patch worked for me.
Comment 43 Albert 2007-08-03 21:55:28 UTC
Could the perlinterpreter patch be replaced with a simple sed script?
Comment 44 Hendrik Friedel 2007-08-14 20:28:13 UTC
I have a problem with the ebuild from attachment 120166 [details].

emerge: there are no ebuilds to satisfy "net-www/apache".
(dependency required by "app-backup/backuppc-3.0.0" [ebuild])

What's wrong?
Comment 45 Randy Barlow 2007-08-14 23:32:04 UTC
Hi Hendrik, net-www/apache changed to www-servers/apache, so just make that change in the ebuild and you will be good to go!
Comment 46 Hendrik Friedel 2007-08-15 15:25:40 UTC
(In reply to comment #45)
> Hi Hendrik, net-www/apache changed to www-servers/apache, so just make that
> change in the ebuild and you will be good to go!

?? That does not sound like a very smart idea?? But well, I'm not an ebuild expert, so never mind.

The install does not really run through, though:
 * Running //usr/sbin/webapp-config -I -h localhost -u root -d /backuppc backuppc 2.1.2-r1
* Fatal error: Your configuration file sets the server type "Apache"
* Fatal error: but the corresponding package does not seem to be installed!
* Fatal error: Please "emerge >=net-www/apache-1.3" or correct your settings.
* Fatal error(s) - aborting

There's net-www again... but anyway: Apache(2!) is installed and running... so there shouldn't be any need to install it...

Greetings,
Hendrik
Comment 47 Jakub Moc (RETIRED) gentoo-dev 2007-08-15 15:51:51 UTC
Please upgrade your webapp-config and don't clutter this bug with irrelevant stuff.
Comment 48 Thomas Bird 2007-08-16 22:07:41 UTC
Created attachment 128335 [details]
New backuppc ebuild

Ive updated the ebuild to work with the new apache name, changed some permissions and changed the perlInterpreter.patch to a sed command, so perlInterpreter.patch is no longer needed.
Comment 49 Thomas Bird 2007-08-16 22:08:57 UTC
Created attachment 128338 [details]
New postinstall-en.txt
Comment 50 Thomas Bird 2007-08-16 22:12:23 UTC
Created attachment 128339 [details]
New .htaccess

These are the changes that Marc suggested, Thanks Marc!
Comment 51 Hendrik Friedel 2007-08-19 14:33:09 UTC
Hi,
i tried to install the ebuild from 2007-08-16 22:07 with the vhosts use flag set.
Accessing http://localhost/backuppc/, I get a Directory listing:
[   ] BackupPC_Admin          19-Aug-2007 16:20  3.9K  
[DIR] backuppc/               19-Aug-2007 16:21    -   
[DIR] image/                  19-Aug-2007 16:21    -   
[   ] index.cgi               19-Aug-2007 16:20  3.2K  
Accessing BackupPC_Admin, I get You don't have permission to access /backuppc/BackupPC_Admin on this server. The apache log says:
(13)Permission denied: file permissions deny server access: /var/www/localhost/htdocs/backuppc/BackupPC_Admin, referer: http://192.168.178.24/backuppc/

Greetings,
Hendrik

Comment 52 Thomas Bird 2007-08-20 12:53:00 UTC
Created attachment 128674 [details]
Updated files/postinstall-en.txt

Hi,

You need to change the AllowOverride option in /etc/apache2/vhosts.d/00_default_vhost.conf from None to all.

I've updated the post-install instructions to say this as well.
Comment 53 Paul Hewlett 2007-11-12 13:28:43 UTC
(In reply to comment #26)
> Thomas, a solution using a single instance of Apache would certainly be quite
> elegant, but the wiki page you referenced still proposed using a separate

Hi Randy - I have just got backuppc 2.1.2 working at my house and work without realising that someone was getting 3.0.0 ebuild working. Would you like the details of what I found wrong with 2.1.2 ebuild or should i post a separate bug?
Comment 54 Randy Barlow 2007-11-12 18:05:17 UTC
I'm not a Gentoo developer, but my guess would be that it would make the most sense to post that in a separate bug report.  It might be relevant to this bug anyway though, since the 3.0.0 ebuild was made from the 2.1.2!  Honestly though, I've kind of given up on the ebuild route to BackupPC for now and just installed it manually on my machines.  I'll probably come back to it in December, but it's just a bit of an odd package and I had trouble deciding how much the ebuild should do, especially with all the apache configuration...
Comment 55 Thomas Beinicke 2007-11-19 09:11:34 UTC
Trying to uninstall the ebuild gives me the following error, any ideas:

 app-backup/backuppc
    selected: 3.0.0-r1
   protected: none
     omitted: none

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in: 5 4 3 2 1
>>> Unmerging app-backup/backuppc-3.0.0-r1...
* WARNING: suid/sgid file(s) with suspicious hardlink(s):
* WARNING:   '/usr/share/webapps/backuppc/3.0.0-r1/htdocs/index.cgi'
* WARNING: See the Gentoo Security Handbook guide for advice on how to proceed.

A removal phase of the 'app-backup/backuppc-3.0.0-r1' package has failed
with exit value 1. The problem occurred while executing the ebuild
located at
'/var/db/pkg/app-backup/backuppc-3.0.0-r1/backuppc-3.0.0-r1.ebuild'. If
necessary, manually remove the ebuild in order to skip the execution of
removal phases.
Comment 56 Carsten Lohrke (RETIRED) gentoo-dev 2008-01-08 00:45:22 UTC
reassign to maintaier
Comment 57 Michael Stowe 2008-02-22 16:09:38 UTC
BackupPC was updated to 3.1.0 on 11-27-2007
Comment 58 Peter Fern 2008-06-11 01:10:34 UTC
(In reply to comment #51)
> i tried to install the ebuild from 2007-08-16 22:07 with the vhosts use flag
> set.
> Accessing http://localhost/backuppc/, I get a Directory listing:

You need to install and enable mod_perl 
Comment 59 Christoph Brill (egore) (RESIGNED) 2008-08-02 21:53:59 UTC
Created attachment 162045 [details]
app-backup/backuppc-3.1.0

This is the ebuild for 3.1.0 ... based on 3.0.0 plus few extra dependencies and repoman warnings fixed.
Comment 60 Roger 2008-10-04 08:03:51 UTC
# emerge backuppc-3.1.0

...

* Install completed - success

 * Running /usr/sbin/webapp-cleaner -p -C backuppc
/usr/sbin/webapp-cleaner: line 14: /sbin/functions.sh: No such file or directory
/usr/sbin/webapp-cleaner: line 95: einfo: command not found
 * Adjusting ownership of various things... ...                                                                        [ ok ]
 * Please read the documentation
 * It is important to know that the webserver and the backuppc user
 * *must* be one and the same


# qfile /usr/sbin/webapp-cleaner 
=app-admin/webapp-config-1.50.16-r1

BTW.  Great work!  

I don't know Gentoo's policy concerning dot files within the "/files" folder, but it might be wise to push ".htaccess" to "htaccess" and then rename the file on install.  However, doins might not have any flexibility in this case.  <shrugs> feedback?
Comment 61 Roger 2008-10-04 08:09:19 UTC
Following bug is still present in backuppc-3.1.0.ebuild:

# emerge -g backuppc
...
>>> Installing app-backup/backuppc-3.1.0
 * suid/sgid file(s) with suspicious hardlink(s):
 * 
 *      /usr/share/webapps/backuppc/3.1.0/htdocs/index.cgi
Comment 62 Roger 2008-10-04 08:46:55 UTC
backuppc-3.1.0.ebuild

# /etc/init.d/backuppc start
backuppc          | * Caching service dependencies ...                                                                 [ ok ]
backuppc          | * No /etc/backuppc/config.pl exists!
backuppc          | * ERROR: backuppc failed to star
Comment 63 Roger 2008-10-04 09:02:03 UTC
Strike my Comment #62.  ... etc-update notice got hidden among backuppc ebuild stdout!

Here's current debug output:

# /etc/init.d/backuppc start
backuppc          | * Caching service dependencies ...                                                                 [ ok ]
backuppc          | * Starting BackupPC ...
backuppc          |/usr/BackupPC/bin/BackupPC: Wrong user: my userid is 124, instead of  ()
backuppc          |Please su  first
backuppc          |BackupPC::Lib->new failed
backuppc          | * start-stop-daemon: failed to start `/usr/BackupPC/bin/BackupPC'                                  [ !! ]
backuppc          | * ERROR: backuppc failed to start
Comment 64 David Relson 2008-10-04 15:32:27 UTC
The newest ebuild works is working for me except for a problem with vhosts

To enable webapp configuration, I added "app-backup/backuppc -vhosts" to /etc/portage/package.use.

http://localhost/cgi-bin/BackupPC_Admin used to be my link for accessing backuppc.  Unfortunately file /var/www/localhost/cgi-bin/BackupPC_Admin isn't part of the new installation.  Instead, files index.cgi and BackupPC_Admin are in directory /var/www/localhost/htdocs/backuppc

When I browse to http://localhost/backuppc, I'm shown a directory listing, i.e.

    Index of /backuppc

    Icon  Name               Last modified      Size  Description
    [DIR] Parent Directory
    [TXT] BackupPC_Admin     04-Oct-2008 10:54  3.9K  
    [DIR] backuppc/          04-Oct-2008 10:56    -   
    [DIR] image/             04-Oct-2008 10:56    -   
    [   ] index.cgi          04-Oct-2008 10:54  5.9K  

Clicking on BackupPC_Admin shows the script, rather than executing it.
Clicking on index.cgi gives a dialog saying:

  You have chosen to open
    which is a:
    from:

(but without any names filled in).

What is the proper URL for accessing BackupPC for my localhost machine ???
Comment 65 David Relson 2008-10-04 16:13:46 UTC
I like the newest ebuild!  It's working well for me, though I've noticed a tweak or two that might be useful.

Observation #1:

in pkg_postins() is:

  chown -Rf backuppc:backuppc /var/lib/BackupPC

since this directory has _all_ the backup files and they likely number thousands, if not millions, this could take a long, long, long time to run.  Right?  Seems like this line should be deleted ...

Observation #2:

looking at my current ebuild, RDEPEND includes app-arch/unzip and www-apache/mod_perl.  I'm not sure whether they're actually necessary.  Can someone more knowledgeable say?

Observation #3:

In src_compile() the set of "echo ... >> backuppc.c" commands can be replaced with a single "cat >> ..." command.  Using cat is probably a bit quicker and, IMHO, more readable.  Here's what I have:

	cat > backuppc.c <<EOF
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main(){
setuid( ${backuppcuseridG} );
system( "./BackupPC_Admin" );
return 0;
}
EOF




Comment 66 matth 2008-12-17 11:00:25 UTC
I've tryed to emerge last ebuild (2008-08-02) on x86 and on amd64.
I've the following error

# emerge -av backuppc
These are the packages that would be merged, in order:
Calculating dependencies \
emerge: there are no ebuilds to satisfy "dev-perl/Compress-Zlib".
(dependency required by "app-backup/backuppc-3.1.0" [ebuild])

It seems that dev-perl/Compress-Zlib doesnt exist anymore
it's now located on perl-core/Compress-Zlib.
I've change it on my ebuild and emerge goes find.
Comment 67 Matthew Kohn 2008-12-22 00:36:39 UTC
emerge perfectly once u change it to dev-perl/Compress-Zlib 

when i try to start the backuppc init it gives me this error.

2008-12-21 19:31:35 $Conf{SendmailPath} = '/usr/sbin/sendmail' is not a valid executable program                       [ !! ]

I have ssmtp installed so that is what it belongs to
"mail-mta/ssmtp-2.62-r3 (/usr/sbin/sendmail -> /usr/sbin/ssmtp)"

 and i can send mail using the program

" sendmail soccer5232@gmail.com
test
"
Received in inbox 



any ideas



Comment 68 Thomas Bird 2008-12-22 14:52:34 UTC
maybe change $Conf{SendmailPath} to /usr/sbin/ssmtp ?
Comment 69 Vijayendra 2008-12-29 09:52:23 UTC
This is an installation problem. If you are using mod_perl then it appears that Apache is not running as user backuppc. If you are not using mod_perl, then most like setuid is not working properly on BackupPC_Admin. Check the permissions on /usr/share/BackupPC/sbin//BackupPC_Admin and look at the documentation. 
Comment 70 Hendrik Friedel 2009-02-23 20:38:28 UTC
Works fine.(*) Thanks!

Why don't I find this in the official portage tree?

2.1.* is so outdated!

----------------
* after this change:
It seems that dev-perl/Compress-Zlib doesnt exist anymore
it's now located on perl-core/Compress-Zlib.
I've change it on my ebuild and emerge goes find.
Comment 71 Philippe PUJAS 2009-03-15 22:40:52 UTC
Created attachment 185117 [details]
Minor but  necessary correction on rdepend

This new ebuild for backuppc 3.1.0 works fine on amd64 and x86
The RDEPEND dev-perl/Compress-Zlib becomes perl-core/Compress-Zlib
due to portage changes
Easy....

Philippe
Comment 72 Philippe PUJAS 2009-03-15 22:43:21 UTC
(In reply to comment #68)
> maybe change $Conf{SendmailPath} to /usr/sbin/ssmtp ?
> 

For me the problem is solved when changing the modes of the mail transfert (in my case ssmtp) :

chmod o+rx /usr/sbin/ssmtp
Comment 73 Till Korten 2009-06-10 04:40:36 UTC
Created attachment 194073 [details]
New ebuild takes care of upgrading

This new ebuild takes great care to properly upgrade from a previous install. This is especially tricky since 2.x used different directory names.

Also it installs and configures a separate apache instance for the web frontend.
no manual reconfiguration needed just start the daemons.

I prefer the separate instance over the setuid method for security reasons. The backuppc user has a lot of power in the network (i.e. can write to any host that is being backed up) therefore I would not risk getting compromised by reusing the standard apache webserver.
httpd conf and other needed files follow.
Comment 74 Till Korten 2009-06-10 04:44:03 UTC
Created attachment 194074 [details]
httpd.conf for the backuppc-apache instance

This is derived from the standard gentoo httpd.conf
I removed some modules already.
The Idea is to keep this as slim as possible.
If someone has ideas how to make this more secure (or less insecure). that would be greatly appreciated
Comment 75 Till Korten 2009-06-10 04:44:48 UTC
Created attachment 194075 [details]
apache config file for the apache instance
Comment 76 Till Korten 2009-06-10 04:46:43 UTC
Created attachment 194077 [details]
init script for the apache instance

the ebuild uses this file only as a fallback solution. Normally it just makes a copy of /etc/init.d/apache2.
The idea is to always get a new file.
don't know if this is the gentoo way, though.
Comment 77 Till Korten 2009-06-10 04:47:18 UTC
Created attachment 194078 [details]
an updated postinstall.txt
Comment 78 Till Korten 2009-06-23 11:44:16 UTC
Created attachment 195552 [details]
updated ebuild that requires perl-core/IO-Compress which replaces perl-core/Compress-Zlib

It would be great if someone with more experience in writing ebuilds could have a look at this. Especially if for the dependencies the directory names are really necessary. I guess if we left those out, portage could more easily resolve blocks like the one for Compress-Zlib and IO-Compress.

I would really like to see this ebuild integrated into the official portage tree, since the version 2.1 in portage is over two years old now!!!
For this I think the following steps are necessary:

* testing: as many people as possible should test this ebuild, both upgrading and fresh installs. (it did work flawlessly for me without any trouble with backup data created by version 2.1)
* evaluation: experienced ebuilders should provide a sanity check
Comment 79 Till Korten 2009-06-23 11:48:39 UTC
Created attachment 195553 [details]
fixed a minor bug.

forgot to reset the IFS after moving the per-host config files to the new location.
Comment 80 Michał Sawicz 2009-07-23 09:23:30 UTC
Guys I'm having problems with this and www-servers/apache-2.2.11-r2, the httpd.conf requires a 'cgi' module which isn't available in the apache mentioned...

Where do I get the mod_cgi.so module from?
Comment 81 Michał Sawicz 2009-07-23 09:24:05 UTC
The same with mod_suexcec.cgi?
Comment 82 Lenno Nagel 2009-09-30 18:44:43 UTC
Hey, I just submitted my own attempt at creating a good ebuild for BackupPC. I rewrote your ebuilds and tested them quite hard. Check out bug #287133 and see if it works for you as well. :)
Comment 83 Alex Legler (RETIRED) archtester gentoo-dev Security 2009-09-30 21:46:26 UTC
Let's just use one bug for this.

*** This bug has been marked as a duplicate of bug 287133 ***