DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-03-05 18:11:32

Sacrelicious
New member
Registered: 2009-08-21
Posts: 3

SSH connects only sometimes

I'm having an issue that I can't for the life of me figure out, so I'm hoping someone will be able to point me in the right direction! First of all though, big thanks to all of you whose posts and work have got me as far as I am!

Ok, here's the problem: I'm running BackupPC on my 323, which I use to back up my server once a day, and everything is working great. But I decided I wanted to secure the rsync connection it uses, so I got SSH tunneling w/ private keys setup, and again, everything works great... when it works. The problem is that the backup through SSH only works maybe 1/3 of the time, and it seems completely random, sometime it will work the first time, sometimes I need to manually start the backup a couple times for it to work. Here is how I have it set up:

In BackupPC under "DumpPreUserCmd" I am running the following ('ssh' is actually in a separate script file, but I figured that was unimportant at the moment):

Code:

ssh -f -4 -L 8001:myserver:873 myserver ping 127.0.0.1 -n 20 -w 20000 > nul

The -L parameter creates the tunnel, and 'ping...' keeps the connection open for 20sec to allow BackupPC to get started, and once it's going it keeps the connection open itself (I'm connecting to Server '08 so 'sleep' isn't available).
So, if I look at my SSH connection logs on the server, I can see that the connection is successful every time, but sometimes the connection closes immediately, and sometimes it pauses the proper 20sec to allow BackupPC to start, when it pauses, the backup works fine, when it doesn't BackupPC throws a "cannot connect" error and the backup fails.

So my question is this: why is SSH only staying open some of the time, and if you don't know the answer offhand, what can I do to diagnose it? If I can't get SSH to work reliably, does anyone know how I can get BackupPC to retry the backup a couple of times if the connection failed?

Thanks in advance for any help you can give, and please let me know if I need to clarify anything.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB