[Checkins] SVN: zc.sshtunnel/trunk/src/zc/sshtunnel/recipe.py Added a fg verb which causes the script to open the tunnel as though it was run directly using ssh. Useful for watching with supervisor
Matthew Wilkes
matthew at matthewwilkes.co.uk
Wed Oct 22 07:26:07 EDT 2008
Log message for revision 92466:
Added a fg verb which causes the script to open the tunnel as though it was run directly using ssh. Useful for watching with supervisor
Changed:
U zc.sshtunnel/trunk/src/zc/sshtunnel/recipe.py
-=-
Modified: zc.sshtunnel/trunk/src/zc/sshtunnel/recipe.py
===================================================================
--- zc.sshtunnel/trunk/src/zc/sshtunnel/recipe.py 2008-10-22 09:33:17 UTC (rev 92465)
+++ zc.sshtunnel/trunk/src/zc/sshtunnel/recipe.py 2008-10-22 11:26:05 UTC (rev 92466)
@@ -114,6 +114,11 @@
else:
wait(wait_port)
print name, 'started'
+ elif verb == 'fg':
+ if os.path.exists(pid_file):
+ print "Pid file %s already exists" % pid_file
+ return
+ os.execvp('ssh', ('-TnaxqNL'+specification, via))
elif verb == 'status':
if os.path.exists(pid_file):
pid = int(open(pid_file).read().strip())
More information about the Checkins
mailing list