openresty/lua-nginx-module

ngx.pipe.spawn shell mode child process not killed after openresty exits

開放

#1,855 建立於 2021年2月19日

 (5 則留言) (0 個反應) (0 位負責人)C (2,038 個分叉)batch import
good first issue

倉庫指標

星標
 (11,407 顆星)
PR 合併指標
 (平均合併 5天 4小時) (30 天內合併 6 個 PR)

描述

When using ngx.pipe.spawn in shell mode (args is a string), sh -c in invoked internally. While OpenResty exists, SIGKILL is sent to sh process, but it's not able to propogate to child process. The child process is then left alive.

POC:

init_work_by_lua_block {
  require("ngx.pipe").spawn("/tmp/a.py")
}

$ cat /tmp/a.py:

#!/usr/bin/env python3
import time
time.sleep(23333)

Then signal stop the OpenResty/Nginx process.

貢獻者指南