LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Rsync Has Unexplained Exit (https://www.linuxquestions.org/questions/linux-server-73/rsync-has-unexplained-exit-642136/)

rkulp 05-14-2008 09:47 AM

Rsync Has Unexplained Exit
 
I am trying to use BackupPC to backup a Windows XP client to a share on a Ubuntu 8.04 computer. The connection is established but within a few seconds rsyncd exits. Here is the log entry on the Windows computer:

2008/05/14 09:21:26 [3320] connect from dick-ubuntu (192.168.0.8)
2008/05/14 09:21:26 [3320] module-list request from dick-ubuntu (192.168.0.8)

Here is the entry on the BackupPC log:

2008-05-14 09:21:20 full backup started for directory
2008-05-14 09:21:20 Got fatal error during xfer (unexpected response: '@RSYNCD: EXIT')
2008-05-14 09:21:25 Backup aborted (unexpected response: '@RSYNCD: EXIT')

This occurs regardless of the length of the module-list.

Here is a typical module entry from the rsyncd.conf file:

[ASD]
path = c:/ASD
comment = ASD Program
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

I can post an entire rsyncd.conf file, if desired.
Any suggestions would be greatly appreciated.

rkulp 05-16-2008 10:25 AM

More Information
 
I followed the debugging suggestion in http://rsync.samba.org/issues.html:

Step 1: Stop backuppc

root@dick-ubuntu:~# /etc/init.d/backuppc stop
* Stopping backuppc... No process in pidfile `/var/run/backuppc/BackupPC.pid' found running; none killed.
[ OK ]

Step 2: start strace

root@dick-ubuntu:~# ulimit -c unlimited
root@dick-ubuntu:~# strace -f rsync --daemon --no-detatch 2>/tmp/rsync-$$.out

Step 3: Started backuppc from another window and forced backup of Windows XP client. This failed as before.

Step 4: Output results of trace:

root@dick-ubuntu:~# cat /tmp/rsync-$$.out
execve("/usr/bin/rsync", ["rsync", "--daemon", "--no-detatch"], [/* 21 vars */]) = 0
brk(0) = 0x809f000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fb7000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=46238, ...}) = 0
mmap2(NULL, 46238, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fab000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libacl.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\25\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=22544, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7faa000
mmap2(NULL, 25344, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7fa3000
mmap2(0xb7fa9000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5) = 0xb7fa9000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libpopt.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260\22"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=27144, ...}) = 0
mmap2(NULL, 30060, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f9b000
mmap2(0xb7fa2000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6) = 0xb7fa2000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260e\1"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1364388, ...}) = 0
mmap2(NULL, 1369712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e4c000
mmap2(0xb7f95000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x149) = 0xb7f95000
mmap2(0xb7f98000, 9840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f98000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libattr.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\f\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=13592, ...}) = 0
mmap2(NULL, 16372, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7e48000
mmap2(0xb7e4b000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb7e4b000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7e47000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7e478c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7f95000, 4096, PROT_READ) = 0
munmap(0xb7fab000, 46238) = 0
rt_sigaction(SIGUSR1, {0x8057950, [], SA_NOCLDSTOP}, NULL, 8) = 0
rt_sigaction(SIGUSR2, {0x8057cd0, [], SA_NOCLDSTOP}, NULL, 8) = 0
rt_sigaction(SIGCHLD, {0x8057d20, [], SA_NOCLDSTOP}, NULL, 8) = 0
time(NULL) = 1210949233
geteuid32() = 0
umask(0) = 022
brk(0) = 0x809f000
brk(0x80c0000) = 0x80c0000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2586, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fb6000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2586
read(3, "", 4096) = 0
close(3) = 0
munmap(0xb7fb6000, 4096) = 0
open("/usr/lib/locale/en_US.UTF-8/LC_CTYPE", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/en_US.utf8/LC_CTYPE", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=254076, ...}) = 0
mmap2(NULL, 254076, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7e08000
close(3) = 0
open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=25700, ...}) = 0
mmap2(NULL, 25700, PROT_READ, MAP_SHARED, 3, 0) = 0xb7fb0000
close(3) = 0
open("/etc/popt", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/root/.popt", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
write(2, "rsync: --no-detatch: unknown opt"..., 52rsync: --no-detatch: unknown option (in daemon mode)) = 52
write(2, "\n", 1
) = 1
write(2, "(Type \"rsync --daemon --help\" fo"..., 63(Type "rsync --daemon --help" for assistance with daemon mode.)) = 63
write(2, "\n", 1
) = 1
rt_sigaction(SIGUSR1, {SIG_IGN}, NULL, 8) = 0
rt_sigaction(SIGUSR2, {SIG_IGN}, NULL, 8) = 0
write(2, "rsync error: syntax or usage err"..., 76rsync error: syntax or usage error (code 1) at options.c(889) [client=2.6.9]) = 76
write(2, "\n", 1
) = 1
exit_group(1) = ?
Process 19640 detached
root@dick-ubuntu:~#

*************************end of debugging info*************
I think the errors at the top of the list can be ignored for now. Please advise if I am wrong. At the bottom of the listing we see w looks like one or more rsync syntax errors but I am not sure how to interpret them.

Does options.c(889) refer to the 889th line of code or something else?

I interpret [client=2.6.9] to be the version of rsync running on the client. The download said it was 2.6.8, but that probably does not matter.

Is the 76 an error code from rsync? If so, where may I find a listing?

Here is the .pl file for the Windows computer with the username and password fields modified:

$Conf{XferMethod} = 'rsyncd';
$Conf{RsyncdUserName}='UUUU';
$Conf{RsyncdPasswd} = 'PPPPP';
$Conf{XferLogLevel} = 2;
$Conf{RsyncShareName} = ['KandAClients','CitizensBank','AscendFCU','K&ABusinessDocuments','Kulp&Associates','USAA','Lions','T SEPWin','TIAA-CREF','VS2005','WACC','ASD','AdvancedInstaller','GenericRegistration'];
$Conf{ClientNameAlias} = 'dick-winxp';
$Conf{ClientCharset} = 'cp1252';

Here is the rsyncd.conf file on the client:

#
# A sample rsyncd.conf file usable with BackupPC. This file does not
# completely document all of the settings for rsyncd.conf - see the
# man page that comes with the rsync ditribution for a comprehensive
# overview off all available settings.
#

#
# Allow rsync to change the root directory to the module location
# upon connection of a client. This is disabled for Win32 as we do
# not provide a full Cygwin environment.
#
# Warning: with a setting of "false", absolute symlinks will be
# stripped of their leading "/". See "use chroot" in the rsyncd.conf
# man page. This is relevant for machines that support symlinks
# (WinXX machines do not).
#
use chroot = false

#
# Limit the simultaneous rsync connections to 4. Changing
# this to '1' should be sufficient for BackupPC.
#
max connections = 4

#
# Uncomment this line and change the path if
# you would like to log rsync messages.
#
log file = c:/rsyncd/rsyncd.log

#
# The location of the rsync process ID file
#
pid file = c:/rsyncd/rsyncd.pid

#
# The locations of the rsync lock file
#
lock file = c:/rsyncd/rsyncd.lock

#
# This is where we define the rsyncd modules. Add as many directories or
# files are you wish. To backup this module using BackupPC, set
# $Conf{RsyncShareName} to "docs" in this client's config.pl.
#
[docs]
#
# Exact DOS style path to the file or directory to be rsync accessible
#
path = c:/Documents and Settings

#
# A short description of the module. This is what is printed when
# using rsync to "browse" the server for what modules are available.
#
comment = Documents and Settings

#
# Does rsyncd ensure that the secrets file is read only by the
# user running the process? If this is false then no check is
# performed (useful for Win32 systems). However, you can change
# this to "true" and make the secrets file READ ONLY by the user
# running the rysncd process. If running from the command line
# or upon login, this should be the user who is logged in. If
# running as a Win32 service, then the SYSTEM account should be
# the only account that can read the secrets file.
#
strict modes = false

#
# What user(s) have access to this module. The user(s) must be
# defined in the secrets file. A comma or space separated list.
#
# Example:
# auth users = backup, root, larry
# auth users = backup root larry
#
auth users = dick,backuppc

#
# The location of the secrets file. Permissions must be READ ONLY
# for the account running the rsyncd process unless
# strict modes = false is set above.
#
secrets file = c:/rsyncd/rsyncd.secrets

#
# What hosts are allowed access to this module? By default, all
# hosts are allowed access. If you wish to further strengthen
# the security of your setup, uncomment and replace with the IP
# address your BackupPC server. This is a flexible setting and
# can be one of:
#
# a dotted decimal IP address: 172.16.0.17
# a address/mask in the form a.b.c.d/n: 172.16.0.0/24
# an address/mask in the form ipaddr/maskaddr: 172.16.0.0/255.255.255.0
# a hostname: backupserver
# a hostname pattern using wildcards: backup*
#
hosts allow = 192.168.0.8

#
# Only allow clients to READ from the server. This prevents uploads
# from remote machines. If you wish to allow uploads, change this too
# "true".
#
# WARNING: Setting this to true means that BackupPC restores via
# rsyncd will fail. You most likely want to set this to "false".
#
read only = false

#
# Don't list this module if a client asks (provides another modest
# layer of security since an attacker also has to guess the module
# name - you could make it obscure if you want - but remember the
# module name is sent in plain text so it can be sniffed).
#
list = false

#
# Example of how to share the entire C: drive. For BackupPC "cDrive"
# is the share name (ie: the value of $Conf{RsyncShareName}).
#
[KandAClients]
path = c:/Clients and TSEPWin Users
comment = Clients and TSEPWin Users
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false


[CitizensBank]
path = c:/CitizensBank
comment = citizens Tri-County Bank
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[AscendFCU]
path = c:/AscendFCU
comment = Ascend
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[K&ABusinessDocuments]
path = c:/K&ABusinessDocuments
comment = K&A Business Documents
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[Kulp&Associates]
path = c:/Kulp&Associates
comment = Kulp & Associates, LLC
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[USAA]
path = c:/USAA
comment = USAA Documents
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[Lions]
path = c:/Lions
comment = Lions Club and MD12S
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[TSEPWin]
path = D:/TSEPWin
comment = TSEPWin Stuff
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[TIAA-CREF]
path = c:/TIAA-CREF
comment = TIAA-CREF QFX FILES
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[VS2005]
path = c:/Visual Studio 2005
comment = VS 2005 Projects and Files
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[WACC]
path = c:/WACC
comment = Wilson Avenue church of Christ files
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[ASD]
path = c:/ASD
comment = ASD Program
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[AdvancedInstaller]
path = d:/AdvancedInstaller
comment = Advanced Installer installation packages
auth users = dick,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

[GenericRegistration]
path = d:Generic Registration VB2005
comment = Code for the registration package
auth users = dick,backuppc,backuppc
secrets file = c:/rsyncd/rsyncd.secrets
hosts allow = 192.168.0.8
strict modes = false
read only = false
list = false

*************End of rsyncd.conf*********************

I would greatly appreciate help for this newbie to Linux. Thanks.

rkulp 05-25-2008 09:01 PM

I give up on rsyncd, at least for now. The Windows shares are always mounted on the Ubuntu server so I thought I might do a tar on those shares. I get the following error: "No files dumped" when I try the following:

$Conf{TarShareName}= ['/etc'.'d$ on dcmqf61'];

and also on the following:

$Conf{TarShareName}= ['/etc'.'d$/TSEPWin'];

or

$Conf{TarShareName}= ['/etc'.'d$ on dcmqf61/TSEPWin'];

Where TSEPWin is a directory on d$. So, I clearly don't know how to address a directory in the mounted share. I also have not come upon the correct way to cd to a directory on the share.

I would appreciate the proper syntax and suggestions for using tar to backup a Windows share mounted on a Ubuntu 8.04 server.

Thanks in advance for helping this Linux newbie.

rkulp 05-29-2008 07:11 PM

Sorta Solved
 
I changed to smb and it works.

unSpawn 05-29-2008 08:42 PM

Good to see you found a workaround. Looking at post #2 around
Code:

write(2, "rsync: --no-detatch: unknown opt"..., 52rsync: --no-detatch: unknown option (in daemon mode)) = 52
it craps out, unfortunately only because of a misspelled switch: there's one "t" too much in "--nodetatch".

rkulp 05-30-2008 07:02 AM

Thanks
 
unSpawn,

Thanks for the correction. I will try rsyncd again.


All times are GMT -5. The time now is 06:56 PM.