Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I have a upstart script like..

exec start-stop-daemon --exec /tmp/ --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?

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer
So you mean it will kill all "/tmp/" in the process list instead? – Ryan Aug 8 '12 at 8:04
I suspect it will killall "", the path isn't usually part of the process name. – DerfK Aug 8 '12 at 12:02
So seems it is not that reliable if using common scrpt name, e.g. – Ryan Aug 8 '12 at 14:10
In that case your script should create a pidfile somewhere when it is run, so you can use --pidfile /some/where with start-stop-daemon. Otherwise, if your script doesn't fork, then you can use --make-pidfile with --pidfile and start-stop-daemon will create one for you. – DerfK Aug 8 '12 at 14:51
Even if I provide --pidfile, how start-stop-daemon know the location when it need to stop? Suppose this file should be stored somewhere? – Ryan Aug 9 '12 at 6:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.