Command execution¶
- async pglift.system.cmd.run(args, *, input=None, capture_output=True, timeout=None, check=False, log_stdout=False, **kwargs)¶
- pglift.system.cmd.start_program(cmd, *, pidfile, logfile, timeout=1, env=None, fs=<object object>)¶
Start program described by ‘cmd’, in the background, and possibly store its PID in ‘pidfile’.
- Raises:
SystemError – if the program is already running.
CommandError – in case program unexpectedly terminates before timeout.
- Parameters:
- Return type:
- pglift.system.cmd.terminate_program(pidfile, *, fs=<object object>)¶
Terminate program matching PID in ‘pidfile’.
Upon successful termination, the ‘pidfile’ is removed. No-op if no process matching PID from ‘pidfile’ is running.
- pglift.system.cmd.status_program(pidfile, *, fs=<object object>)¶
Return the status of a program which PID is in ‘pidfile’.
- Raises:
SystemError – if the program is already running.
CommandError – in case program execution terminates after timeout.
- Parameters:
- Return type:
Status