Re: kern.shutdown_timeout sysctl not working

From: Bruce Evans <bde_at_zeta.org.au>
Date: Thu, 26 Feb 2004 01:13:33 +1100 (EST)
On Wed, 25 Feb 2004, Dominic Bishop wrote:

> I tried setting the value of the kern.shutdown_timeout sysctl and it failed
> with:
>
> sysctl: unknown oid 'kern.shutdown_timeout'

This was broken by bogus garbage collecting more than 5 years ago.  I use
the following fix, but don't use the sysctl and haven't tested if it still
works with init(8):

%%%
Index: init_main.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/init_main.c,v
retrieving revision 1.241
diff -u -2 -r1.241 init_main.c
--- init_main.c	4 Feb 2004 21:52:55 -0000	1.241
+++ init_main.c	5 Feb 2004 10:38:55 -0000
_at__at_ -102,4 +102,7 _at__at_
 int	bootverbose;
 SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, &bootverbose, 0, "");
+static int shutdowntimeout = 120;
+SYSCTL_INT(_kern, OID_AUTO, shutdown_timeout, CTLFLAG_RW,
+    &shutdowntimeout, 0, "");

 /*
%%%

Kernel sysctls are a wrong way to control applications, but this sysctl
should have remained supported while init uses it.

Bruce
Received on Wed Feb 25 2004 - 05:13:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:44 UTC