More debug output
This commit is contained in:
parent
6333260f9a
commit
d984f728cc
|
|
@ -132,7 +132,11 @@ class sys_command():
|
||||||
return self.exec()
|
return self.exec()
|
||||||
|
|
||||||
def __leave__(self, *args, **kwargs):
|
def __leave__(self, *args, **kwargs):
|
||||||
|
if 'debug' in self.opts and self.opts['debug']:
|
||||||
|
print('[N] Leaving subsystem routine.')
|
||||||
os.waitpid(self.pid, 0)
|
os.waitpid(self.pid, 0)
|
||||||
|
if 'debug' in self.opts and self.opts['debug']:
|
||||||
|
print('[N] (Bye bye!)')
|
||||||
|
|
||||||
def exec(self):
|
def exec(self):
|
||||||
if not self.cmd[0][0] == '/':
|
if not self.cmd[0][0] == '/':
|
||||||
|
|
@ -183,13 +187,16 @@ class sys_command():
|
||||||
print('[N] Last command finished, exiting subsystem.')
|
print('[N] Last command finished, exiting subsystem.')
|
||||||
alive = False
|
alive = False
|
||||||
break
|
break
|
||||||
|
|
||||||
yield output
|
yield output
|
||||||
|
|
||||||
|
if 'debug' in self.opts and self.opts['debug']:
|
||||||
|
print('[N] Exited subsystem, instructing it to shutdown.')
|
||||||
# Since we're in a subsystem, we gotta bail out!
|
# Since we're in a subsystem, we gotta bail out!
|
||||||
# Bail bail bail!
|
# Bail bail bail!
|
||||||
os.write(child_fd, b'shutdown now\n')
|
os.write(child_fd, b'shutdown now\n')
|
||||||
|
|
||||||
|
if 'debug' in self.opts and self.opts['debug']:
|
||||||
|
print('[N] Waiting for exit code.')
|
||||||
exit_code = os.waitpid(self.pid, 0)[1]
|
exit_code = os.waitpid(self.pid, 0)[1]
|
||||||
|
|
||||||
if exit_code != 0:
|
if exit_code != 0:
|
||||||
|
|
@ -198,6 +205,9 @@ class sys_command():
|
||||||
print('[?] Command executed: {}'.format(self.cmd))
|
print('[?] Command executed: {}'.format(self.cmd))
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
if 'debug' in self.opts and self.opts['debug']:
|
||||||
|
print('[N] Subsystem routine complete.')
|
||||||
|
|
||||||
def simple_command(cmd, opts=None, *args, **kwargs):
|
def simple_command(cmd, opts=None, *args, **kwargs):
|
||||||
if not opts: opts = {}
|
if not opts: opts = {}
|
||||||
if 'debug' in opts:
|
if 'debug' in opts:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue