DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 26th January 2013
bob701 bob701 is offline
New User
 
Join Date: Jan 2013
Posts: 4
Thanked 0 Times in 0 Posts
Default BackupPC on OpenBSD?

I'm trying to get BackupPC and the web interface running on OpenBSD. Previously I've had it working on Fedora Linux and FreeBSD.

Problem:
/etc/rc.d/backuppc start
/etc/rc.d/wwbackuppc start
^ both fail after a fresh OpenBSD install with BackupPC

First I have noticed that the _backuppc user doesn't get created and the permissions are wrong in various areas which I found by starting BackupPC as the user _backuppc. After permissions were fixed, backuppc started.

Now the remaining problem is that I can't get /etc/rc.d/wwbackuppc to start. When I execute the command as described in the rc file, I get: "spawn-fcgi: child exited with: 2"
Reply With Quote
  #2   (View Single Post)  
Old 27th January 2013
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,116
Thanked 182 Times in 149 Posts
Default

If you are having problems with the web interface please note that by default the Apache version in base runs chrooted.

See http://www.openbsd.org/faq/faq10.html#httpdchroot for the implications that could have.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 27th January 2013
bob701 bob701 is offline
New User
 
Join Date: Jan 2013
Posts: 4
Thanked 0 Times in 0 Posts
Default

Thanks for the reply.
I changed rc.conf to start httpd with the "-u" flag to run unchrooted but still the same problem.

To be honest I know almost nothing about web interfaces but I get the following output:
Code:
perl /usr/local/bin/BackupPC_Admin.fcgi
<h1>Software error:</h1>
<pre>Can't locate FCGI.pm in @INC (@INC contains: /usr/local/libdata/perl5/site_perl/i386-openbsd [...]) at /usr/libdata/perl5/CGI/Fast.pm. line 25.
...
?

Last edited by ocicat; 27th January 2013 at 10:53 AM. Reason: Please use [code] & [/code] tags when posting output.
Reply With Quote
  #4   (View Single Post)  
Old 27th January 2013
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,116
Thanked 182 Times in 149 Posts
Default

That is a Perl error message, saying that it cannot find a module in the Perl module PATH @INC

The following tiny test program also triggers the same error:
Code:
$  cat -n test.pl ; ./test.pl
     1  #!/usr/bin/perl
     2  
     3  use strict;
     4  use warnings;
     5  
     6  use CGI::Fast;
     7  
     8  print "This is a test\n";
     9  
    10 Can't locate FCGI.pm in @INC (@INC contains:
/usr/local/libdata/perl5/site_perl/amd64-openbsd
/usr/libdata/perl5/site_perl/amd64-openbsd
/usr/local/libdata/perl5/site_perl /usr/libdata/perl5/site_perl
/usr/libdata/perl5/amd64-openbsd/5.12.2
/usr/local/libdata/perl5/amd64-openbsd/5.12.2 /usr/libdata/perl5
/usr/local/libdata/perl5 .) at /usr/libdata/perl5/CGI/Fast.pm line 25.
BEGIN failed--compilation aborted at /usr/libdata/perl5/CGI/Fast.pm line 25.
Compilation failed in require at ./test.pl line 6.
BEGIN failed--compilation aborted at ./test.pl line 6.
The relevant lines from the CGI::Fast module:
Code:
     1  package CGI::Fast;
     2  use strict;
     3  
     4  # A way to say "use warnings" that's compatible with even older perls.
     5  # making it local will not affect the code that loads this module
     6  # and since we're not in a BLOCK, warnings are enabled until the EOF
     7  local $^W = 1;
     8  
     9  # See the bottom of this file for the POD documentation.  Search for the
    10  # string '=head'.
    11  
    12  # You can run this file through either pod2man or pod2html to produce pretty
    13  # documentation in manual or html file format (these utilities are part of the
    14  # Perl 5 distribution).
    15  
    16  # Copyright 1995,1996, Lincoln D. Stein.  All rights reserved.
    17  # It may be used and modified freely, but I do request that this copyright
    18  # notice remain attached to the file.  You may modify this module as you
    19  # wish, but if you redistribute a modified version, please attach a note
    20  # listing the modifications you have made.
    21  
    22  $CGI::Fast::VERSION='1.08';
    23  
    24  use CGI;
    25  use FCGI;
It is rather strange that a Perl module in the OpenBSD base Perl distribution has a dependency on an external module.

But all of this does not help you much. Later on today I have some time, and will try to install backuppc myself.

How did you install it? Through packages or ports? Which version of OBSD are you using?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #5   (View Single Post)  
Old 27th January 2013
bob701 bob701 is offline
New User
 
Join Date: Jan 2013
Posts: 4
Thanked 0 Times in 0 Posts
Default

Hi, that would be much appreciated. I installed OpenBSD 5.2 i386 using the "install52.iso" without x* and game* sets (from the cd). Then I set PKG_PATH and installed BackupPC from the ftp mirror using pkg_add.

Aha:
Thanks for the info on the missing dependency issue. Turns out it just didn't install the 'fcgi' dependency. Solved by running:
Code:
pkg_add fcgi
So as a summary the problems I ran into:
1. Required _backuppc user was not created.
2. BackupPC configuration and data directories therefore had wrong permissions.
3. Required dependency fcgi not installed.

Not 100% sure weather httpd needs to run unchrooted but I havn't finished setting up yet.

Last edited by bob701; 27th January 2013 at 09:17 PM.
Reply With Quote
  #6   (View Single Post)  
Old 28th January 2013
bob701 bob701 is offline
New User
 
Join Date: Jan 2013
Posts: 4
Thanked 0 Times in 0 Posts
Default

I have it pretty much working now. This is what I had to do.

1. Install backuppc and optionally rsync...

2. Install missing dependencies bzip2 fcgi

3. Make user _backuppc following FreeBSD default, optionally using chpass after initial creation:
UID: 300
GID: 300
Full Name: BackupPC pseudo-user
Home Dir: /var/db/backuppc
Shell: /sbin/nologin

4. chown _backuppc:_backuppc recursively on:
/etc/backuppc
/var/db/backuppc
/var/log/backuppc

5. Move /var/www/conf/modules.sample/backuppc.conf to /var/www/conf/modules/backuppc.conf
(Make sure you did what it said after the installation for the other packages)

6. Add the following to the "<Location>..." in backuppc.conf (we need to be able to login):
Code:
        AuthType Basic
        AuthUserFile /conf/users/backuppc
        AuthName "BackupPC"
        require valid-user
(It is setup to work with chrooted httpd)

7. Make a user:
Code:
htpasswd -c /var/www/conf/users/backuppc username
8. Make sure you have the user in /etc/backuppc/hosts

9. Start services on boot. Add the following to rc.conf.local:
Code:
httpd_flags=""
pkg_scripts="backuppc wwbackuppc"
10. Configure BackupPC. You might want to make your BackupPC user an administrator for the web interface.

Last edited by bob701; 28th January 2013 at 03:48 AM.
Reply With Quote
  #7   (View Single Post)  
Old 28th January 2013
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,431
Thanked 214 Times in 189 Posts
Default

The port of BackupPC has no $MAINTAINER of record, as it is maintained by a number of OpenBSD developers. You might consider posting about your experience with it to the OpenBSD ports@ mailing list.

If you do not yet use the mailing lists and wish to do so, please see http://www.openbsd.org/mail.html for details.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:50 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick