supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* sv exit doesn't seem to work properly
@ 2006-10-01 20:19 Vincent Danen
  2006-10-02  2:05 ` Alex Efros
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Danen @ 2006-10-01 20:19 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 2128 bytes --]

Using runit 1.6.0, it doesn't look like "sv exit" is working as it
should.  I'm working to replace some scripts which use svwaitdown in
/etc/runit/3 with using sv, and was trying to use "sv exit [service]"
but when I do, the service goes down, runsv is killed, but then within a
few seconds it's starting again.  It's almost like it's not properly
writing the new state for runsvdir to know we want it down.

If I use "sv down [service]" the service goes down properly.  It's not
that big of a deal to use sv down in stage 3 I guess, but it's not
what's illustrated in the sample debian script (which uses
force-stop then exit).  I figure using exit alone would be
sufficient (force-stop shuts the service down but then it comes
right back up when I use exit).

Am I doing something wrong?

My stage 3 script looks like this:

[vdanen@build trunk]$ cat 3
#!/bin/execlineb

/bin/fdmove -c 2 1

/bin/export PATH "/sbin:/bin:/usr/sbin:/usr/bin"

/sbin/chpst -e /etc/sysconfig/env/runit/

/bin/import -D 180 STAGE_3_TIMEOUT
/bin/import -D 14 GETTY_TIMEOUT

/bin/elglob -0 GETTYS /service/mingetty-*
/bin/elglob -0 ALLSERVICES /service/*

/bin/foreground { /bin/echo "Waiting up to ${GETTY_TIMEOUT} seconds for getties to stop..." }
/bin/foreground { /sbin/sv -w $GETTY_TIMEOUT force-stop $GETTYS }
/bin/foreground { /sbin/sv exit $GETTYS }

/bin/foreground { /bin/echo "Waiting up to ${STAGE_3_TIMEOUT} seconds for services to stop..." }
/bin/foreground { /sbin/sv -w $STAGE_3_TIMEOUT force-stop $ALLSERVICES }
/bin/foreground { /sbin/sv exit $ALLSERVICES }

/bin/foreground { /bin/echo "Executing shutdown..." }

/sbin/rc 0


It's pretty much the same as the debian script with a few additions and
it's written in execline rather than bash.

Any ideas?  Right now I'm thinking just to use force-stop and get rid of
the exit call altogether and let /sbin/rc handle sending all the runsv
services the TERM signal when shutting the system down.

-- 
{FEE30AD4 : 7F6C A60C 06C2 4811 FA1C  A2BC 2EBC 5E32 FEE3 0AD4}
mysql> SELECT * FROM users WHERE clue > 0;
Empty set (0.00sec)

[-- Attachment #2: Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-02  2:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-01 20:19 sv exit doesn't seem to work properly Vincent Danen
2006-10-02  2:05 ` Alex Efros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).