-=head2 Debugging installation problems
-
-This section will probably grow based on the types of questions on
-the BackupPC mail list. Eventually the FAQ at
-L<http://backuppc.sourceforge.net/faq/> will include more details
-than this section.
-
-=over 4
-
-=item Check log files
-
-Assuming BackupPC can start correctly you should inspect __TOPDIR__/log/LOG
-for any errors. Assuming backups for a particular host start, you
-should be able to look in __TOPDIR__/pc/$host/LOG for error messages
-specific to that host. Always check both log files.
-
-=item CGI script doesn't run
-
-Perhaps the most common program with the installation is getting the
-CGI script to run. Often the setuid isn't configured correctly, or
-doesn't work on your system.
-
-First, try running BackupPC_Admin manually as the BackupPC user, eg:
-
- su __BACKUPPCUSER__
- __CGIDIR__/BackupPC_Admin
-
-Now try running it as the httpd user (which ever user apache runs as);
-
- su httpd
- __CGIDIR__/BackupPC_Admin
-
-In both cases do you get normal html output?
-
-If the first case works but the second case fails with an error that
-the wrong user is running the script then you have a setuid problem.
-(This assumes you are running BackupPC_Admin without mod_perl, and
-you therefore need seduid to work. If you are using mod_perl then
-apache should run as user __BACKUPPCUSER__.)
-
-First you should make sure the cgi-bin directory is on a file system
-that doesn't have the "nosuid" mount option.
-
-Next, experiment by creating this script:
-
- #!/bin/perl
-
- printf("My userid is $> (%s)\n", (getpwuid($>))[0]);
-
-then chown it to backuppc and chmod u+s:
-
- root# chown backuppc testsetuid
- root# chmod u+s testsetuid
- root# chmod a+x testsetuid
- root# ls -l testsetuid
- -rwsr-xr-x 1 backuppc wheel 76 Aug 26 09:46 testsetuid*
-
-Now run this program as a normal user. What uid does it print?
-Try changing the first line of the script to directly call sperl:
-
- #!/usr/bin/sperl5.8.0
-
-(modify according to your version and path). Does this work
-instead?
-
-Finally, you should invoke the CGI script from a browser, using
-a URL like:
-
- http://myHost/cgi-bin/BackupPC/BackupPC_Admin
-
-You should make sure REMOTE_USER is being set by apache (see the
-earlier section) so that user authentication works. Make sure
-the config settings $Conf{CgiAdminUserGroup} and $Conf{CgiAdminUsers}
-correctly specify the privileged administrator users.
-
-=item You cannot access per-host information in the CGI interface
-
-If you get the error
-
- Only privileged users can view information about host xyz
-
-it means that BackupPC_Admin is unable to match the user's login
-name (supplied by Apache via the REMOTE_USER environment variable)
-with either that host's user name (in the conf/hosts file) or
-with the administrators specified in the $Conf{CgiAdminUsers}
-or $Conf{CgiAdminUserGroup} settings.
-
-The most common problem is that REMOTE_USER is not set because the
-Apache authentication is not correctly configured. In this case
-BackupPC_Admin will report this additional error:
-
- Note: $ENV{REMOTE_USER} is not set, which could mean there is an
- installation problem. BackupPC_Admin expects Apache to authenticate
- the user and pass their user name into this script as the REMOTE_USER
- environment variable. See the documentation.
-
-You should review the configuration instructions to setup Apache
-authentication correctly. To test if REMOTE_USER is being set
-correctly, there is a simple script called printenv that is
-included with Apache. This is a simple CGI script that prints
-out all the environment variables. Place this script in the
-same directory as BackupPC_Admin and run it with a URL like:
-
- http://myHost/cgi-bin/BackupPC/printenv
-
-Check the value of the REMOTE_USER environment variable.
-Here's a copy of the printenv script:
-
- #!/usr/bin/perl
- ##
- ## printenv -- demo CGI program which just prints its environment
- ##
-
- print "Content-type: text/plain\n\n";
- foreach $var (sort(keys(%ENV))) {
- $val = $ENV{$var};
- $val =~ s|\n|\\n|g;
- $val =~ s|"|\\"|g;
- print "${var}=\"${val}\"\n";
- }
-
-=item Can't ping or find host
-
-Please read the section L<How BackupPC Finds Hosts|how backuppc finds hosts>.
-
-The BackupPC_dump command now has a -v option, so the easiest way to
-debug backup problems on a specific host is to run BackupPC_dump
-manually as the BackupPC user:
-
- su __BACKUPPCUSER__
- __INSTALLDIR__/bin/BackupPC_dump -v -f hostName
-
-This will run a full dump on hostName (replace with your host name).
-It will show each command (eg: ping, nmblookup and the full dump
-commands) and the output from each command. Reading the output
-carefully should show you what the problem is.
-
-You can also verify that nmblookup correctly returns the netbios name.
-This is essential for DHCP hosts, and depending upon the setting of
-$Conf{FixedIPNetBiosNameCheck} might also be required for fixed IP
-address hosts too. Run this command:
-
- nmblookup -A hostName
-
-Verify that the host name is printed. The output might look like:
-
- received 7 names
- DELLLS13 <00> - P <ACTIVE>
- DOMAINNAME <00> - <GROUP> P <ACTIVE>
- DELLLS13 <20> - P <ACTIVE>
- DOMAINNAME <1e> - <GROUP> P <ACTIVE>
- DELLLS13 <03> - P <ACTIVE>
- DELLLS13$ <03> - P <ACTIVE>
- CRAIG <03> - P <ACTIVE>
-
-The first name, converted to lower case, is used for the host name.
-
-=item Transport method doesn't work
-
-The BackupPC_dump command has a -v option, so the easiest way to
-debug backup problems on a specific host is to run BackupPC_dump
-manually as the BackupPC user:
-
- su __BACKUPPCUSER__
- __INSTALLDIR__/bin/BackupPC_dump -v -f hostName
-
-This will run a full dump on hostName (replace with your host name)
-and will print all the output from each command, including the log
-output.
-
-The most likely problems will relate to connecting to the smb shares on
-each host. On each failed backup, a file __TOPDIR__/pc/$host/XferLOG.bad.z
-will be created. This is the stderr output from the transport program.
-You can view this file via the CGI interface, or manually uncompress it
-with;
-
- __INSTALLDIR__/bin/BackupPC_zcat __TOPDIR__/pc/$host/XferLOG.bad.z | more
-
-The first line will show the full command that was run (eg: rsync, tar
-or smbclient). Based on the error messages you should figure out what
-is wrong. Possible errors on the server side are invalid host, invalid
-share name, bad username or password. Possible errors on the client
-side are misconfiguration of the share, username or password.
-
-You should try running the command manually to see what happens.
-For example, for smbclient you should it manually and verify that
-you can connect to the host in interactive mode, eg:
-
- smbclient '\\hostName\shareName' -U userName