[Dirvish] ssh problem with pre-client & rsync server

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Mon Jun 6 06:02:09 PDT 2005


I wrote:
> I'm trying to use dirvish to back up a machine that's running mysql and 
> I'm having a problem with ssh login.
...
> The problem appears to be that dirvish is trying to run the ssh command 
> using the rsync server username, which is pretty arbitrary but 
> deliberately different from any valid linux username on the client 
> machine and especially not root! OTOH, ssh needs a valid linux username, 
> I think.
...
> Or is it time to dive into the code?

I dived into the code. The simplest way I could think of to fix this 
problem was to add another config variable 'pre-post-rsh'. If present, 
the value of this variable is used to completely specify the connection 
to the remote machine for the pre-client and post-client actions. It 
needs to be specified in the vault's config file, not the master config 
file. For example, I added the following line to the config file I 
showed before:

   pre-post-rsh:   ssh -l root 192.168.2.2

and now everything works. This is the patch to dirvish:

--- /usr/local/sbin/dirvish.orig
+++ /usr/local/sbin/dirvish
@@ -591,9 +591,11 @@
  		log	=> $log_file,
  		dir	=> $srctree,
  		env	=> $WRAPPER_ENV,
-		shell	=> (($$Options{client} eq $$Options{Server})
-			?  undef
-			: "$$Options{rsh} $$Options{client}"),
+		shell	=> ($$Options{'pre-post-rsh'}
+			   ? $$Options{'pre-post-rsh'}
+			   : (($$Options{client} eq $$Options{Server})
+			     ?  undef
+			     : "$$Options{rsh} $$Options{client}")),
  	);
  	if ($status{'pre-client'})
  	{
@@ -726,9 +728,11 @@
  		log	=> $log_file,
  		dir	=> $srctree,
  		env	=> $WRAPPER_ENV,
-		shell	=> (($$Options{client} eq $$Options{Server})
-			?  undef
-			: "$$Options{rsh} $$Options{client}"),
+		shell	=> ($$Options{'pre-post-rsh'}
+			   ? $$Options{'pre-post-rsh'}
+			   : (($$Options{client} eq $$Options{Server})
+			     ?  undef
+			     : "$$Options{rsh} $$Options{client}")),
  	);
  	if ($status{'post-client'})
  	{

Cheers, Dave



More information about the Dirvish mailing list