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

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

I'm trying to use dirvish to back up a machine that's running mysql and 
I'm having a problem with ssh login.

Before installing mysql, I already set up dirvish to back up the machine 
using an rsync server; that's been working fine for a while. I've now 
installed mysql and to make sure that I get a clean dump of the database 
I need to send a remote command before rsync runs:
   etc/init.d/mysql stop
I've added this to my default.conf (see below for details).
This is failing in my dirvish-runall with an ssh error:

   04:36:56 dirvish --vault suse3-root --image-time "22:00"
   Permission denied (publickey,keyboard-interactive).
   suse3-root:default pre-client failed (65280)

I have set up ssh to use id_rsa and can run ssh from the command line 
without a problem (suse1 is the backup server, suse3 is the backup 
client/mysql server). For example:

   suse1# ssh suse3 date
   Mon Jun  6 10:22:48 BST 2005

But if I run dirvish from the command line I am prompted for a password:

   suse1# dirvish --vault suse3-root -image test

Using ps I can see the command that dirvish is trying to run:

   root      2715  2713  0 10:26 pts/1    00:00:00 sh -c ssh
   backup at ' DIRVISH_SERVER=suse1
   DIRVISH_IMAGE=suse3-root:default:test /etc/init.d/mysql stop'

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.

The only option I can see in the dirvish.conf doc is 'rsh' but when I add:
   rsh:            ssh -l root
to my default.conf, the ssh command is transformed to nonsense:

   sh -c ssh -l root backup at ' DIRVI...<snip>

Has anybody else come across this issue? Have I missed some other way to 
configure this to work? Or is it time to dive into the code?

Cheers, Dave

My default.conf is:

# default.conf
# Vault Config file for dirvish backup of suse3

# this is the rsync username at host combination for the rsync server
# NOT a linux username
client: backup at

password-file: /root/rsync.password.suse3

# colon at start of tree tells dirvish to contact a remote rsync daemon.
# tree value is actually an rsync 'module' name, NOT a filesystem path.
tree:   :root


# Make sure mysqld is shut down whilst we take the backup
rsh:            ssh -l root
pre-client:     /etc/init.d/mysql stop
post-client:    /etc/init.d/mysql start

xdev:   1

index:  gzip

image-default:  %Y-%m-%d


# Last rule that matches applies.
# Sun = 1, Sat = 7 !!
    *  *      2-31        *     1-5,7      +1 week
    *  *       *          *        6       +2 months
    *  *       1          *        *       +1 year

More information about the Dirvish mailing list