Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 120044 - sys-apps/watchdog init script restart fails
Summary: sys-apps/watchdog init script restart fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor
Assignee: Henrik Brix Andersen
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2006-01-23 05:33 UTC by Christoph Probst
Modified: 2006-02-01 07:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Probst 2006-01-23 05:33:50 UTC
Watchdog needs some time to shutdown so if you execute "/etc/init.d/watchdog restart" the start() call is very likley to fail.

setoy init.d # /etc/init.d/watchdog restart
 * Stopping watchdog ...                               [ ok ]
 * Starting watchdog ...                               [ !! ]

Maybe it helps to utilize the -R/--retry option of start-stop-daemon to ensure a proper shutdown.
Comment 1 Henrik Brix Andersen 2006-01-23 05:46:49 UTC
Missing `emerge --info` output.
Comment 2 Christoph Probst 2006-01-23 07:10:29 UTC
setoy ~ # emerge --info
Portage 2.0.54 (default-linux/x86/2005.0, gcc-3.3.6, glibc-2.3.5-r2, 2.6.11-hardened-r15 i686)
=================================================================
System uname: 2.6.11-hardened-r15 i686 Intel(R) Celeron(R) CPU 2.00GHz
Gentoo Base System version 1.6.14
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O3 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium3 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict userpriv"
GENTOO_MIRRORS="http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="de_DE@euro"
MAKEOPTS="-s -j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 aalib acl acpi apache2 audiofile avi berkdb bitmap-fonts bzip2 bzlib calendar cgi cli cpdflib crypt ctype curl curlwrappers dba dvb eds emboss encode ethereal exif expat foomaticdb fortran ftp gd gdbm gif gmp gstreamer gtk2 iconv idn imagemagick imap imlib inifile ipv6 java jikes jpeg junit lcms libg++ libwww mad maildir mbox mcal memlimit mhash mikmod mime ming mmx mng mp3 mpeg mysql ncurses nls nptl ogg oggvorbis pam pcre pdflib pear perl php png python qmail readline recode sdl session sharedext simplexml slang sockets spamassassin spell spl sqlite sse ssl tcpd tetex tidy tiff tokenizer truetype truetype-fonts type1-fonts udev vhost vorbis xml xml2 xmlrpc xmms xsl zeo zip zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS
Comment 3 Henrik Brix Andersen 2006-01-23 07:46:00 UTC
Thanks.

I can not reproduce this with sys-apps/baselayout-1.12.0_pre15, and I can't see any reason as to why watchdog would need special handling in this regard.

Roy, is this a known issue (s-s-d not trying hard enough to kill daemons with 1.11.x)?
Comment 4 Roy Marples (RETIRED) gentoo-dev 2006-01-23 07:57:51 UTC
s-s-d --stop in 1.11 just sends a signal 15 returns right away. It does not test to see if the daemon is still running or not.

With baselayout-1.12 we ensure that the daemon really does stop before we return.
Comment 5 Christoph Probst 2006-01-23 08:21:43 UTC
I run some timing tests and it came out that watchdog always takes 5 seconds to shutdown. Same with s-s-d and a direkt kill -15:

  setoy ~ # /etc/init.d/watchdog start
  setoy ~ # while (ps auxww|grep watch|grep dog) do date ; done 

In another shell I run:

  setoy ~ # /etc/init.d/watchdog stop; date
   * Stopping watchdog ...                    [ ok ]
  Mo Jan 23 16:59:35 CET 2006


The last message in the first shell is:

   root 24810 0.0 0.6 1572 1568 ? Ss 16:56 0:00
                                /usr/sbin/watchdog --no-action
   Mo Jan 23 16:59:40 CET 2006


Adding --retry 5 to s-s-d resolves the problem.
Comment 6 Roy Marples (RETIRED) gentoo-dev 2006-01-23 08:30:30 UTC
--retry works across all baselayout versions.

baselayout-1.12 has a default --retry of 5, whereas 1.11 does not retry by default.
Comment 7 Henrik Brix Andersen 2006-02-01 07:37:57 UTC
Fixed in CVS. Wait a couple of hours, emerge --sync and re-emerge.