Debian Developers - start-stop-daemon

This is Interesting: Free IT Magazines  
Home > Archive > Debian Developers > February 2004 > start-stop-daemon





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author start-stop-daemon
GCS

2004-02-25, 9:37 am

Hi!

I would like to use start-stop-daemon for a daemon, which has a control
program. On stop, I have to call it with the argument stop. It's ok if I
do it alone, but I must be sure it's really stopped. For this I would
like to use start-stop-daemon --stop with --retry, but on --stop, it's
also sends a signal, which kills the process without let it any chance
to clean up even in normal cases. How can I achieve this with
start-stop-daeamon or is it impossible?

Thanks,
GCS


--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Matthew Palmer

2004-02-25, 9:37 am

On Wed, Feb 25, 2004 at 04:37:13AM +0100, GCS wrote:
> I would like to use start-stop-daemon for a daemon, which has a control
> program. On stop, I have to call it with the argument stop. It's ok if I
> do it alone, but I must be sure it's really stopped. For this I would


You could try running the control program a few times, checking between each
invokation to see if the daemon is really dead. After a while, you can then
use start-stop-daemon to kill it manually.

> like to use start-stop-daemon --stop with --retry, but on --stop, it's
> also sends a signal, which kills the process without let it any chance
> to clean up even in normal cases. How can I achieve this with
> start-stop-daeamon or is it impossible?


Sounds like dodgy signal handling by your daemon. ssd by default sends
SIGTERM, which should be handled cleanly. If you want to change signals,
use the --signal option to ssd.

- Matt


--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Henrique de Moraes Holschuh

2004-02-25, 9:37 am

On Wed, 25 Feb 2004, Matthew Palmer wrote:
> On Wed, Feb 25, 2004 at 04:37:13AM +0100, GCS wrote:
>
> You could try running the control program a few times, checking between each
> invokation to see if the daemon is really dead. After a while, you can then
> use start-stop-daemon to kill it manually.


And you can use ssd --start --test to check if the daemon is really dead,
btw.

--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh


--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
GCS

2004-02-25, 9:37 am

On Wed, Feb 25, 2004 at 01:35:20AM -0300, Henrique de Moraes Holschuh <hmh@debian.org> wrote:
>
> And you can use ssd --start --test to check if the daemon is really dead,
> btw.

Thanks for both of you for the answers. I think I misunderstood the
purpose of --stop and --retry. I thought it does the looping for me, and
I would reinvent the wheel if I do the looping for myself. Matt, I know
--signal, but SIGTERM is quite OK, I just don't need it immediately
delivered. See the timeframe:
- control program is called with the 'stop' argument,
- loop for for example five seconds, and every second check if the
daemon really exited. If yes, then return.
- if the loop expired, but daemon is still running, _only then_ deliver
the signal.

Instead I get the signal delivered as soon I invoke ssd, at least it
seems as the daemon does not even reach the first line for printing
'shutting down...'.

Cheers,
GCS


--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Adrian 'Dagurashibanipal' von Bidder

2004-02-25, 9:37 am

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com