#19 interact ignores child exit on solaris

open
nobody
None
5
2008-05-28
2008-05-28
Anonymous
No

When using pexpect to connect via ssh (not using pxssh), after exiting a subprocess that was handed to the user via interact(), the parent will usually hang until a key is pressed unless the processes is being watched via truss (the solaris ptrace equivelant).

Example:

/SP/AgentInfo/Console started
/SP/AgentInfo/ ->
/SP/AgentInfo/ -> exit
Connection to sxbeta16-mgmt closed.
[hangs here until a keypess]
OK: sxbeta16
nortonp@sys1 14:12 ~/work/update-consoles/update-consoles $

The code just looks like this:
def start_console(self, test=False, too_verbose=False):
user = self.username

args = {'user': user,
'cmd' : "start /SP/AgentInfo/Console",
'module': __name__}

if test == True:
print ("%(module)s going to send: %s" % cmd)
else:
sys.stdout.write("Press ctrl-] to end")
self.spawn.sendline(args['cmd'])
self.spawn.interact(chr(29))

It should return after this.

-Peter

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks