Gentoo Archives: gentoo-dev

From: Roy Marples <uberlord@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] SIGTERM vs SIGINT
Date: Tue, 04 Apr 2006 21:38:03
Message-Id: 200604042235.51370.uberlord@gentoo.org
1 Hi List!
2
3 Let me tell you about a little scenario.
4 dhcpcd starts, calls resolvconf
5 resolvconf then updates it's files and runs it's plugins - libc (nscd),
6 dnsmasq and bind which restart via their init script if required.
7 Each service (nscd, dnsmasq and bind) can be stopped and started easily.
8
9 Now, when dhcpcd receives a stop signal it runs resolvconf again, which it
10 should by design. Quite happily it runs he plugins and restarts dnsmasq, bind
11 and/or nscd so that the interface that dhcpcd handled doesn't publish its dns
12 information anymore.
13
14 However - if dhcpcd was stopped by a SIGTERM then the restarted services do
15 get restarted and it seems to work, but the services (nscd, dnsmasq, bind)
16 are unresponsive and can only be killed by a SIGKILL. Not good.
17
18 Every other signal that causes a "stop" (SIGINT, SIGQUIT, etc) that can be
19 trapped works just fine and services continue as they are.
20
21 So why am I writing this email? Well, start-stop-daemon, by default, uses
22 SIGTERM. Another example of this was my new openvpn scripts calling
23 resolvconf when openvpn stopped causing the same behaviour as dhcpcd as
24 described above.
25
26 As more and more init scripts "stopping" can trigger other services to
27 restart, it becomes very desirable for this not to happen. So I propose for
28 the next baselayout release (1.12.0_pre17) to default start-stop-daemon calls
29 to SIGINT for stop commands instead of the current SIGTERM. My testing on my
30 boxes has no adverse effects so far.
31
32 So ...... thoughts? Good or bad idea? Reasons and explanations welcome :)
33
34 --
35 Roy Marples <uberlord@g.o>
36 Gentoo Linux Developer
37 --
38 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] SIGTERM vs SIGINT Stuart Herbert <stuart@g.o>