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

I need to run a start-stop-daemon for a redis instance and I want it to send a SIGTERM and if the redis instance doesn't quit i would like it to force a quit.

The start-stop-daemon configuration says that the --retry option can be used for that but i couldn't figure a way to do this, here's my current command:

/sbin/start-stop-daemon --stop --retry forever/TERM --quiet --oknodo --pidfile /var/run/redis/ --exec /usr/bin/redis-server

Any hints on how I would be able to do this?

share|improve this question
up vote 8 down vote accepted

There are two ways:

The first is just to specify a numeric --retry value. Then it will use /signal/timeout/KILL/timeout schedule. I.e. send a terminating signal (specified with --signal option), then wait the specified number of seconds and then send a KILL signal that could not be ignored by a process and therefore it will be forced to exit. The command will look like:

/sbin/start-stop-daemon --stop --signal TERM --retry 5 --quiet --oknodo --pidfile /var/run/redis/ --exec /usr/bin/redis-server

The second is to specify a complete schedule to the --retry option. It will look like:

/sbin/start-stop-daemon --stop --retry TERM/5/KILL/10 --quiet --oknodo --pidfile /var/run/redis/ --exec /usr/bin/redis-server
share|improve this answer

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.