Hi,
Keith Edmunds wrote on 21.05.2007 at 23:10:13 [[BackupPC-users] no ping (host
not found)]:
> BackupPC 2.1.1
>
> I have:
>
> $Conf{PingPath} = '/bin/echo';
>
> I set up a host using a short (non-FQDN) name, but with an entry in
> ~backuppc/.ssh/config to point to the correct host, along the lines of:
>
> host shortname
> hostname fully.qualified.domain.name
>
> As user backuppc, 'ssh shortname' works. In the /etc/backuppc/hosts file,
> I refer to the host as 'shortname'. If I force a full backup, I get 'no
> ping (host not found)'. Given that '/bin/echo -c 1 shortname' has an exit
> status of 0, why am I getting this error?
BackupPC still tries to resolve the host name, either via DNS
(gethostbyname() actually) or via NMB. There are several things you could
do:
1. Set $Conf{ClientNameAlias} = 'fully.qualified.domain.name';
This is probably what is intended in such a case. It would also save you
the .ssh/config entry. You could even ping the host before backup to find
out if it is alive (presuming that is not blocked).
2. Put an entry for shortname in /etc/hosts.
That's not really a nice thing to do, but it should work.
3. Set $Conf{NmbLookupFindHostCmd} = '';
If I don't misread the code, BackupPC::Lib::NetBiosHostIPFind would in
this case return the hostname, which would satisfy BackupPC_dump, as it
would appear the lookup succeeded. The following code would not seem to
mind that, though if the result is actually used in a meaningful way,
you'll obviously run into problems, because shortname can't really be
resolved.
I don't know if this workaround is a bug or a feature :-).
4. Set $Conf{NmbLookupFindHostCmd} = '&{sub {return "1.2.3.4 shortname";}}';
Wow, I should really test such things before I post them :-).
I don't know if this has any advantages over (3), but I guess it's a
possibility to provide a static IP address in a host config file.
Supposing this works, you should be able to set
$Conf {PingCmd} = '&{sub {""}}';
instead of executing a /bin/echo just to fake a successful return code.
Besides, it's really /bin/true, not /bin/echo :-).
All of these (err, except (2) :-) would belong in the host specific
configuration file, of course. NmbLookupFindHostCmd is probably meant as a
global setting, but I don't see anything that would prevent you from
overriding it in the host config file.
> Also, I couldn't see a log file that would help me resolve this problem
> myself - did I miss something?
There should be a "Can't find host shortname via netbios" in the log file,
which hints at the problem, if not more.
Regards,
Holger
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
BackupPC-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/