how to get the ID of a process executed via setsid

后端 未结 2 611
我寻月下人不归
我寻月下人不归 2021-01-18 16:01

I\'m planning to control some programs (like a media player and a shell) via a webapp, since the webpage die everytime the user visits it, I decided that the webapp will ope

2条回答
  •  情歌与酒
    2021-01-18 16:26

    You still need to background the process with &, otherwise it'll be running in the foreground blocking the following lines from even attempting to execute.

    setsid bash -i fifoout 2>&1 &
    kill $!
    

提交回复
热议问题