Hi, I thought this bug was fixed back in 2009? root@kg-v7# uname -a FreeBSD kg-v7.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #7: Sat Jul 9 23:00:31 CEST 2011 root@kg-v7.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64 root@kg-v7# root@kg-v7# service devd status devd is running as pid 555. root@kg-v7# service devd restart Stopping devd. Starting devd. devd: devd already running, pid: 555 /etc/rc.d/devd: WARNING: failed to start devd root@kg-v7# service devd status devd is not running. What gives? -- Torfinn
On Thu, Feb 02, 2012 at 09:22:22PM +0100, Torfinn Ingolfsen wrote:> Hi, > > I thought this bug was fixed back in 2009? > root@kg-v7# uname -a > FreeBSD kg-v7.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #7: Sat Jul 9 23:00:31 CEST 2011 root@kg-v7.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64 > root@kg-v7# > root@kg-v7# service devd status > devd is running as pid 555. > root@kg-v7# service devd restart > Stopping devd. > Starting devd. > devd: devd already running, pid: 555 > /etc/rc.d/devd: WARNING: failed to start devd > root@kg-v7# service devd status > devd is not running. > > What gives?This is probably "what gives", as it's a common problem with all sorts of daemons and is not specific to devd in the least: - devd is running (pid 555) - Admin issues "service devd restart" -- devd is sent SIGTERM; devd internally starts shutting down, but is not fully dead yet. "kill" does not block (wait) for processes to end, obviously -- Same script issues a start of devd, which fails because the daemon is still running (still shutting down) -- Resulting message is failure - Between failure message and below step, devd shuts down - Admin issues "service devd status" -- Script states devd isn't running I imagine either rc.subr(8) check_pidfile or wait_for_pids needs to be used, presumably in devd_stop () (which would need to be added/written). I do not know the implications of adding this, however, as there may be situations where (say on system shutdown) that you want things to "just end immediately" and not wait for the daemon to cleanly shut down. I say this because of devd's direct ties to devctl(4). Doug, any thoughts? -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |
On 3 February 2012 00:22, Torfinn Ingolfsen <torfinn.ingolfsen@broadpark.no> wrote:> Hi, > > I thought this bug was fixed back in 2009? > root@kg-v7# uname -a > FreeBSD kg-v7.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #7: Sat Jul ?9 23:00:31 CEST 2011 ? ? root@kg-v7.kg4.no:/usr/obj/usr/src/sys/GENERIC ?amd64 > root@kg-v7# > root@kg-v7# service devd status > devd is running as pid 555. > root@kg-v7# service devd restart > Stopping devd. > Starting devd. > devd: devd already running, pid: 555 > /etc/rc.d/devd: WARNING: failed to start devd > root@kg-v7# service devd status > devd is not running. > > What gives?Please apply this patch and report how it goes for you. http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/rc.d/devd.diff?r1=1.12;r2=1.13 This is not in 8-STABLE yet. -- wbr, pluknet
On Fri, 03 Feb 2012 08:34:10 +0300 Sergey Kandaurov <pluknet@gmail.com> wrote:> Please apply this patch and report how it goes for you. > http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/rc.d/devd.diff?r1=1.12;r2=1.13 > > This is not in 8-STABLE yet.It looks like it (or almost the same) is here already: root@kg-v2# more /etc/rc.d/devd #!/bin/sh # # $FreeBSD: src/etc/rc.d/devd,v 1.11.2.2 2011/04/29 20:31:52 dougb Exp $ # # PROVIDE: devd # REQUIRE: netif network_ipv6 # BEFORE: NETWORKING mountcritremote # KEYWORD: nojail shutdown . /etc/rc.subr name="devd" rcvar=`set_rcvar` command="/sbin/${name}" start_precmd=${name}_prestart stop_precmd=find_pidfile find_pidfile() { if get_pidfile_from_conf pid-file /etc/devd.conf; then pidfile="$_pidfile_from_conf" else pidfile="/var/run/${name}.pid" fi } devd_prestart () { find_pidfile # If devd is disabled, turn it off in the kernel to avoid memory leaks. if ! checkyesno ${rcvar}; then $SYSCTL hw.bus.devctl_disable=1 fi } load_rc_config $name run_rc_command "$1" HTH -- Torfinn
Just because of what I read already is pretty terse I am top-posting for a reason. $ su - # /etc/rc.d/devd stop # pgrep -l devd (This should show nothing if so kill the results) # /sbin/devd -D -d (Paste the results) On Fri, Feb 03, 2012 at 08:41:10PM +0100, Torfinn Ingolfsen wrote:> On Fri, 03 Feb 2012 08:34:10 +0300 > Sergey Kandaurov <pluknet@gmail.com> wrote: > > > Please apply this patch and report how it goes for you. > > http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/rc.d/devd.diff?r1=1.12;r2=1.13 > > > > This is not in 8-STABLE yet. > > It looks like it (or almost the same) is here already: > root@kg-v2# more /etc/rc.d/devd > #!/bin/sh > # > # $FreeBSD: src/etc/rc.d/devd,v 1.11.2.2 2011/04/29 20:31:52 dougb Exp $ > # > > # PROVIDE: devd > # REQUIRE: netif network_ipv6 > # BEFORE: NETWORKING mountcritremote > # KEYWORD: nojail shutdown > > . /etc/rc.subr > > name="devd" > rcvar=`set_rcvar` > command="/sbin/${name}" > > start_precmd=${name}_prestart > stop_precmd=find_pidfile > > find_pidfile() > { > if get_pidfile_from_conf pid-file /etc/devd.conf; then > pidfile="$_pidfile_from_conf" > else > pidfile="/var/run/${name}.pid" > fi > } > > devd_prestart () > { > find_pidfile > > # If devd is disabled, turn it off in the kernel to avoid memory leaks. > if ! checkyesno ${rcvar}; then > $SYSCTL hw.bus.devctl_disable=1 > fi > } > > load_rc_config $name > run_rc_command "$1" > > HTH > -- > Torfinn > > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"-- ;s =;