DragonFly users List (threaded) for 2009-02
DragonFly BSD
DragonFly users List (threaded) for 2009-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: off-box mirror-stream and friends


From: Michael Neumann <mneumann@xxxxxxxx>
Date: Mon, 16 Feb 2009 12:15:25 +0100

Am Mon, 16 Feb 2009 11:45:45 +0100
schrieb Michael Neumann <mneumann@ntecs.de>:

> Am Sun, 15 Feb 2009 21:38:54 -0800 (PST)
> schrieb Matthew Dillon <dillon@apollo.backplane.com>:
> 
> > :I have what appears to be a 'Catch 22', wherein:
> > :
> > :hammer mirror-stream /master <user>@<remote_IP>:/new_slave
> > :
> > :returns:
> > :
> > :PFS slave /new-slave does not exist.
> > :Do you want to create a new slave PFS? (yes|no) No terminal for
> > response :Aborting operation
> > :validate_mrec_header: short read
> > :
> > :'No terminal for response'  .was ass u me ed to be a byproduct of
> > comign :in off an Xfce4-terminal (Xorg & Xfce4 are quite happy on
> > 2.3.0, BTW) :
> > :Dropped back out to the raw tty0 console and tried it from there.
> > :
> > :No joy.
> > 
> >     Definitely a bug in the hammer utility, I'm not sure there is 
> >     anything I can do about it though because the remote ssh
> > connection has no channel to accept a Y or N answer... stdin and
> > stdout are used for the protocol stream and I think stderr is output
> > only.
> > 
> >     In anycase, I think what this means is that this feature
> > currently only works if the slave is local (non-ssh connection).
> > So you would be able to do it with <remote_master> <local_slave>.
> 
> Hm, I remember that we implemented this feature (auto-creation of
> slaves) so that it can operate over ssh. And IIRC, it once worked 
> for me using ssh (I am not sure if this was a remote machine or not).
> Does this mean, it is broken?

Looking at function getyn() posted by Bill Hacker I
eventually understand what's wrong. Code - the universal language...

So, really, the best thing that we can do is to introduce a
--force-slave-pfs-creation switch and replace the getyn() call in
cmd_mirror.c by a simple if (ForceSlavePfsCreation...). I like this
more than the original approach (using ttys), as it is usable from
within scripts.

While we are working on this, we could replace all
interactivity in hammer utilities with optional command line switches.
So the strategy could be: first look if there is a switch specified, if
not, fall back to /dev/tty, if this fails, assume NO.

I do not like a command line switch "-f", which means anything
(including force). It's too easy to mix it up with "-f" meaning
"--file". Think about doing some admin work late after midnight, and
your fingers go again faster than your brain; while a "rm -rf" on a
Hammer FS would give you a second chance, a mixed up "hammer
mirror-copy -f" would probably not :). I really would like to see a
--force here (or a more specific one).

Regards,

  Michael



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]