Skip to content

Loading…

Add ssh_debug ini option for cmd_standby #2

Merged
merged 2 commits into from

3 participants

@a1exsh
Collaborator

Before this, turning debug on would also add -vvv to ssh, which was just too noisy.

@commandprompt commandprompt merged commit b8e7770 into commandprompt:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 15, 2012
  1. @ashcmd

    Fix file permissions.

    ashcmd committed
  2. @ashcmd
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 6 deletions.
  1. 0 cmd_archiver.ini.sample
  2. +6 −5 cmd_standby
  3. +5 −1 cmd_standby.README
  4. +3 −0 cmd_standby.ini.sample
View
0 cmd_archiver.ini.sample 100755 → 100644
File mode changed.
View
11 cmd_standby 100644 → 100755
@@ -87,6 +87,7 @@ master_public_ip = config.defaults()['master_public_ip']
master_local_ip = config.defaults()['master_local_ip']
user = config.defaults()['user']
debug = config.defaults()['debug']
+ssh_debug = config.defaults()['ssh_debug']
port = config.defaults()['port']
ssh_timeout = config.defaults()['ssh_timeout']
archivedir = config.defaults()['archivedir']
@@ -174,16 +175,13 @@ def notify_critical_func():
# Configure some basics
if debug == "on":
- ssh_flags = "-vvv -o ConnectTimeout=%s -o StrictHostKeyChecking=no" % (str(ssh_timeout))
rsync_flags = "-avzl --delete --stats --exclude=backup_label"
pg_standby_flags = "-s5 -w0 -d -c"
if pgversion == '8.2':
pg_standby_args = "%%f %%p -k%s" % (float(numarchives))
else:
pg_standby_args = "%f %p %r"
-
else:
- ssh_flags = "-o ConnectTimeout=%s -o StrictHostKeyChecking=no" % (str(ssh_timeout))
rsync_flags = "-azl --delete --exclude=backup_label"
pg_standby_flags = "-s5 -w0 -c"
if pgversion == '8.2':
@@ -191,6 +189,11 @@ else:
else:
pg_standby_args = "%f %p %r"
+if ssh_debug == "on":
+ ssh_flags = "-vvv -o ConnectTimeout=%s -o StrictHostKeyChecking=no" % (str(ssh_timeout))
+else:
+ ssh_flags = "-o ConnectTimeout=%s -o StrictHostKeyChecking=no" % (str(ssh_timeout))
+
ssh_connect = """%s %s %s@%s""" % (str(ssh), str(ssh_flags), str(user),str(master_public_ip))
# Yes the odd counted " is needed because of the way we have to quote within the command
@@ -248,8 +251,6 @@ def get_datadirs_func():
print "HINT: Did you apply cmd_standby.sql?"
print "EXCEPTION: %s" % (str(e))
paths = os.popen("%s -c %s\"" % (str(ssh_psql),str(query)))
- if debug == 'on':
- print "DEBUG: " + paths
return paths.readlines()
# Start a base backup on the master
View
6 cmd_standby.README
@@ -113,7 +113,11 @@ The user who performed initdb
* debug: on
-If you want lots of diagnostic info
+If you want the diagnostic info
+
+ * ssh_debug: on
+
+If you want lots of ssh diagnostic info
* ssh_timeout: 30
View
3 cmd_standby.ini.sample
@@ -36,6 +36,9 @@ user: postgres
; on or off
debug: off
+; on or off
+ssh_debug: off
+
; the timeout for ssh before we throw an alarm
ssh_timeout: 30
Something went wrong with that request. Please try again.