Ubuntu – Where did start-stop-daemon store the pid file by default

bashdebianshellUbuntuupstart

When I have a upstart script like..

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

I suppose will save the pid file somewhere and later use it for stop or restart, right?

So where is the pid file created by default?

Best Answer

Nowhere. Per the start-stop-daemon manpage:

Note: unless --pidfile is specified, start-stop-daemon behaves similar to killall(1). start-stop-daemon will scan the process table looking for any processes which match the process name, uid, and/or gid (if specified). Any matching process will prevent --start from starting the daemon. All matching processes will be sent the TERM signal (or the one specified via --signal or --retry) if --stop is specified. For daemons which have long-lived children which need to live through a --stop, you must specify a pidfile.