def stop_program_if_running():
"""
Gets the group process ID from the process ID of shell script triggered by UDEV rule.
Then calls the kill function.
"""
pid = get_pid("[s]tart_checkout")
print(pid)
print(type(pid))
pgid = os.getpgid(int(pid[0]))
logging.debug(
"[usb_checkout][stop_program_if_running] PGID: {}".format(pgid))
delete_tempfile(filename)
kill(pgid)
评论列表
文章目录