start-stop-daemon在哪里默认存储pid文件?

当我有一个暴发户的脚本像..

exec start-stop-daemon --exec /tmp/test.sh --background --start 

我想将保存在某个地方的pid文件,并稍后使用它stoprestart ,对不对?

那么默认情况下创build的pid文件在哪里?

无处。 按照start-stop-daemon页:

注意:除非指定了–pidfile,否则start-stop-daemon的行为类似于killall(1)。 start-stop-daemon会扫描进程表,查找与进程名称,uid和/或gid(如果指定)相匹配的进程。 任何匹配的进程将阻止 – 启动守护进程。 如果指定了–stop,所有匹配的进程将被发送TERM信号(或通过–signal或–retry指定的信号)。 对于需要通过“停顿”生存的长生不老的守护进程,您必须指定一个pid文件。