Capturing the PID of a background process started by a Makefile

前端 未结 2 809
花落未央
花落未央 2021-01-02 15:39

I have a Makefile that starts a Django web server. I would like the server to be started in the background, with the PID saved to a file.

My recipe looks like this:<

2条回答
  •  长情又很酷
    2021-01-02 15:49

    If Make gives you too much trouble, you can always have the target launch an sh script; in that script, launch the process, background, and then output the pid to a file.

提交回复
热议问题