BackupPC-users

Re: [BackupPC-users] shadowmountrsync

2013-02-21 00:26:21
Subject: Re: [BackupPC-users] shadowmountrsync
From: <backuppc AT kosowsky DOT org>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Thu, 21 Feb 2013 00:24:15 -0500
Shawn T Perry wrote at about 18:35:27 -0700 on Wednesday, February 20, 2013:
 > On Wed, Feb 13, 2013 at 7:11 PM, <backuppc AT kosowsky DOT org> wrote:

 > When I connect via ssh with this command:
 > ssh -q -x [email protected] "/usr/local/bin/shadowmountrsync -u 1 
 > -A 3"
 > 
 > It hangs.  Below is the log file.  Rsync is running.
 > 
 > --Successfully unwound shadow recursion...[Pass #0]
 > --Termination completed...[Pass #0]
 > 
 > 
 > [02/20/13 18:30:42]
 > [2924|3172][svc_autobackup||svc_autobackup|svc_autobackup]
 > /usr/local/bin/shadowmountrsync -d [Pass #0]
 > ***Terminating and cleaning up shadows, mounts, and locks (PID=3172)...[Pass 
 > #0]
 > --Manually clean up...[Pass #0]
 > ..Finished clean_up... [Pass #0]
 > --Termination completed...[Pass #0]
 > 
 > 
 > [02/20/13 18:32:40]
 > [2148|3840][svc_autobackup||svc_autobackup|svc_autobackup]
 > /usr/local/bin/shadowmountrsync -u 1 -A 3 [Pass #1]
 > ***Initial pass through (PID=3840)...[Pass #1]
 > ..Finished clean_up... [Pass #1]
 > --Starting ACL backup for volumes: E: [Pass #1]
 > ..Finished ACL backup for volumes: E: [Pass #1]
 > --Relaunching via 'cmd.exe'...[Pass #1]

This is likely the problem -- when launched via sshd, the script should be
relaunching using 'at.exe' rather than 'cmd.exe'. However,
my routine assumes that $USERNAME under cygwin ssh is 'SYSTEM' -- this
is true for Win XP. But it appears that under other versions of
cygwin/Windows, the USERNAME is different -- in your case
'svc_autobackup'.

 > --Initial pass going into background waiting for setup to complete...[Pass 
 > #1]
 > 
 > [02/20/13 18:32:46]
 > [1|3268][svc_autobackup||svc_autobackup|svc_autobackup]
 > /usr/local/bin/shadowmountrsync -2 -u 1 -A 3 [Pass #2]
 > **Running inital shadow setup (PID=3268)...[Pass #2]
 > --Starting shadow copy and waiting for 'exec' script to terminate...[Pass #2]
 > 
 > [02/20/13 18:32:49]
 > [1|1388][svc_autobackup||svc_autobackup|svc_autobackup]
 > /usr/local/bin/shadowmountrsync -3 -2 -u 1 -A 3 [Pass #3]
 > **Running exec command spawned by vshadow (PID=1388)...[Pass #3]
 > ..Drive letters=Z   [Pass #3]
 > ..Shadow mounts=E:   [Pass #3]
 >     Z:->E:  \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy30
 >         Z: on /shadow/Z type ntfs (binary,user)
 > --Starting rsyncd daemon (with shadow mounts) and waiting for file
 > transfer to complete...[Pass #3]
 > ..Rsyncd Params: Conf=/etc/rsyncd.conf Address= Port= BWLimit=
 > Other=...[Pass #3]
 > ..Rsyncd started successfully (PID=2712)...[Pass #1]

The reason that 'ssh' hangs is that it is waiting for the shadows to
set up properly. However, since it is relaunching using cmd.exe and
not at.exe, the SYSTEM-type user tries to launch vshadow and it lacks
permissions so it never completes, thus leaving ssh hanging. Actually,
if you waited long enough, it would timeout from the 'wait' loop and
return (you would need to wait TIMEOUT seconds).

In any case, I have adjusted the code so that it now automatically
determines the 'sshd' user based on matching the UID from 'ps -e' with
the /etc/passwd file.

Here is the updated code. If it doesn't work, please send me a
log so I can see what is or isn't working...

Attachment: shadowmountrsync-0.4.9
Description: Binary data

Good luck!
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/
<Prev in Thread] Current Thread [Next in Thread>