From sacadmin Fri Aug 28 14:32:06 2009
Received: from nihil.sfbay.sun.com (nihil.SFBay.Sun.COM [129.146.228.161])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7SLW6Zw008093;
	Fri, 28 Aug 2009 14:32:06 -0700 (PDT)
Received: from nihil.sfbay.sun.com (localhost [127.0.0.1])
	by nihil.sfbay.sun.com (8.14.3+Sun/8.14.3) with ESMTP id n7SLW6Kj168281;
	Fri, 28 Aug 2009 14:32:06 -0700 (PDT)
Received: (from lianep@localhost)
	by nihil.sfbay.sun.com (8.14.3+Sun/8.14.3/Submit) id n7SLW6HQ168279;
	Fri, 28 Aug 2009 14:32:06 -0700 (PDT)
Date: Fri, 28 Aug 2009 14:32:06 -0700 (PDT)
From: Liane Praza <lianep@nihil.sfbay.sun.com>
Message-Id: <200908282132.n7SLW6HQ168279@nihil.sfbay.sun.com>
To: PSARC-record@sac.sfbay.sun.com
Subject: tcp_keepalive For inetd Services [PSARC/2009/470 Self Review]
Status: RO
Content-Length: 565


Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
This information is Copyright 2009 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 tcp_keepalive For inetd Services
    1.2. Name of Document Author/Supplier:
	 Author:  Gary Mills
    1.3  Date of This Document:
	28 August, 2009
4. Technical Description
    See the case directory for more detail

6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		ON
    6.5. ARC review type: Automatic
    6.6. ARC Exposure: open


From liane.praza@sun.com Fri Aug 28 14:34:33 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7SLYWbw008142
	for <psarc-ext@sac.sfbay.sun.com>; Fri, 28 Aug 2009 14:34:32 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n7SLYURu008887;
	Fri, 28 Aug 2009 22:34:30 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP300301VXI4200@nwk-avmta-2.sfbay.sun.com>; Fri,
 28 Aug 2009 14:34:30 -0700 (PDT)
Received: from jurassic-x4600.sfbay.sun.com ([129.146.17.59])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP300JCSVXHG850@nwk-avmta-2.sfbay.sun.com>; Fri,
 28 Aug 2009 14:34:29 -0700 (PDT)
Received: from [129.146.228.161] (nihil.SFBay.Sun.COM [129.146.228.161])
	by jurassic-x4600.sfbay.sun.com (8.14.3+Sun/8.14.3)
 with ESMTP id n7SLYSuZ236615; Fri, 28 Aug 2009 14:34:28 -0700 (PDT)
Date: Fri, 28 Aug 2009 14:34:28 -0700
From: Liane Praza <liane.praza@sun.com>
Subject: 2009/470 tcp_keepalive For inetd Services
To: psarc-ext@sun.com
Cc: mills@cc.umanitoba.ca, Sean Wilcox <swilcox@sun.com>
Message-id: <4A984D64.6070501@sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
User-Agent: Thunderbird 2.0.0.22 (X11/20090804)
Status: RO
Content-Length: 1625

I'm filing this case for Gary as closed-approved-automatic, as it seems an 
obvious extension to existing interface.  As usual, speak up if you'd like 
to see it promoted to a fasttrack.

liane

---

tcp_keepalive For inetd Services
Gary Mills
08/27/2009

1. Summary

The inetd restarter defines a set of properties to control the behaviour 
of the services it manages.  This case adds the option `tcp_keepalive' to 
the inetd restarter.  Setting this option enables the TCP keepalive 
facility for connections to services managed by inetd.  It's needed 
because some services do not have the ability to enable this facility by 
themselves.

This property is set to false by default for inetd services, and the 
stability is Committed.

2. Manpage diffs

*** inetd.Ocat    Wed Aug 26 16:39:12 2009
--- inetd.cat    Wed Aug 26 16:40:32 2009
***************
*** 473,478 ****
--- 473,487 ----
            set to true.


+      tcp_keepalive
+
+          If true, enable the periodic transmission of messages on
+          a  connected  socket.  If  the  connected party fails to
+          respond to these  messages,  the  connection   is   con-
+          sidered  broken.  This  applies  only  to  services with
+          endpoint_type set to streams and wait set to false.
+
+
        tcp_trace

            If true, and this is a nowait-type service,  inetd  logs
***************
*** 566,571 ****
--- 575,581 ----
          inherit_env         true
          max_con_rate        -1
          max_copies          -1
+        tcp_keepalive       false
          tcp_trace           false
          tcp_wrappers        false

From Andrew.Gabriel@sun.com Fri Aug 28 15:13:05 2009
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7SMD468009033
	for <psarc-ext@sac.sfbay.sun.com>; Fri, 28 Aug 2009 15:13:04 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n7SMD3bZ061080
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Fri, 28 Aug 2009 16:13:04 -0600 (MDT)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP300501XPHX800@nwk-avmta-2.sfbay.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@Sun.COM); Fri, 28 Aug 2009 15:12:53 -0700 (PDT)
Received: from gmp-eb-inf-1.sun.com ([192.18.6.21])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP300JC2XPGGF70@nwk-avmta-2.sfbay.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@Sun.COM); Fri,
 28 Aug 2009 15:12:53 -0700 (PDT)
Received: from fe-emea-10.sun.com
 (gmp-eb-lb-1-fe1.eu.sun.com [192.18.6.7] (may be forged))
	by gmp-eb-inf-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n7SMCqB0017956	for
 <PSARC-ext@Sun.COM>; Fri, 28 Aug 2009 22:12:52 +0000 (GMT)
Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KP300D00XNROS00@fe-emea-10.sun.com> for PSARC-ext@Sun.COM
 (ORCPT PSARC-ext@Sun.COM); Fri, 28 Aug 2009 23:12:36 +0100 (BST)
Received: from [81.187.162.109] ([unknown] [81.187.162.109])
 by fe-emea-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KP300C0NXOZGGA0@fe-emea-10.sun.com>; Fri,
 28 Aug 2009 23:12:35 +0100 (BST)
Date: Fri, 28 Aug 2009 23:12:37 +0100
From: Andrew Gabriel <Andrew.Gabriel@sun.com>
Subject: Re: 2009/470 tcp_keepalive For inetd Services
In-reply-to: <4A984D64.6070501@sun.com>
Sender: Andrew.Gabriel@sun.com
To: Liane Praza <Liane.Praza@sun.com>
Cc: PSARC-ext@sun.com, mills@cc.umanitoba.ca, Sean Wilcox <swilcox@sun.com>
Message-id: <4A985655.8080705@sun.com>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <4A984D64.6070501@sun.com>
User-Agent: Thunderbird 2.0.0.21 (X11/20090323)
Status: RO
Content-Length: 1192

Liane Praza wrote:
> I'm filing this case for Gary as closed-approved-automatic, as it seems 
> an obvious extension to existing interface.  As usual, speak up if you'd 
> like to see it promoted to a fasttrack.
> 
> liane
> 
> ---
> 
> tcp_keepalive For inetd Services
> Gary Mills
> 08/27/2009
> 
> 1. Summary
> 
> The inetd restarter defines a set of properties to control the behaviour 
> of the services it manages.  This case adds the option `tcp_keepalive' 
> to the inetd restarter.  Setting this option enables the TCP keepalive 
> facility for connections to services managed by inetd.  It's needed 
> because some services do not have the ability to enable this facility by 
> themselves.

This is quite different from any of the existing inetd configuration 
parameters - inetd doesn't currently allow manipulation of socket 
configuration parameters.
Please can you describe a case where this is intended to be used? (I 
ask, because mostly whenever I do see it being used, the author 
misunderstood what it does and shouldn't have been using it.)
Why do you intend to allow access to this socket parameter, but no 
others (such as SO_SNDBUF, SO_RCVBUF, etc)?

-- 
Cheers
Andrew

From gdamore@sun.com Fri Aug 28 15:19:21 2009
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7SMJKgm009264
	for <psarc-ext@sac.sfbay.sun.com>; Fri, 28 Aug 2009 15:19:20 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n7SMJ2qJ065241
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Fri, 28 Aug 2009 16:19:20 -0600 (MDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP300L0ZY06V500@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@Sun.COM); Fri, 28 Aug 2009 16:19:18 -0600 (MDT)
Received: from sca-es-mail-2.sun.com ([192.18.43.133])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP300CI2Y05XD70@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@Sun.COM); Fri,
 28 Aug 2009 16:19:18 -0600 (MDT)
Received: from fe-sfbay-10.sun.com ([192.18.43.129])
	by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n7SMJHMT003610	for
 <PSARC-ext@Sun.COM>; Fri, 28 Aug 2009 15:19:17 -0700 (PDT)
Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KP300L00XTUV700@fe-sfbay-10.sun.com> for PSARC-ext@Sun.COM
 (ORCPT PSARC-ext@Sun.COM); Fri, 28 Aug 2009 15:19:17 -0700 (PDT)
Received: from [192.168.251.11] ([unknown] [76.93.15.33])
 by fe-sfbay-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KP300DZ0Y05EX30@fe-sfbay-10.sun.com>; Fri,
 28 Aug 2009 15:19:17 -0700 (PDT)
Date: Fri, 28 Aug 2009 15:19:17 -0700
From: "Garrett D'Amore" <gdamore@sun.com>
Subject: Re: 2009/470 tcp_keepalive For inetd Services
In-reply-to: <4A984D64.6070501@sun.com>
Sender: Garrett.Damore@sun.com
To: Liane Praza <Liane.Praza@sun.com>
Cc: PSARC-ext@sun.com, mills@cc.umanitoba.ca, Sean Wilcox <swilcox@sun.com>
Message-id: <4A9857E5.5070409@sun.com>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <4A984D64.6070501@sun.com>
User-Agent: Thunderbird 2.0.0.18 (X11/20081201)
Status: RO
Content-Length: 1782

Liane Praza wrote:
> I'm filing this case for Gary as closed-approved-automatic, as it 
> seems an obvious extension to existing interface.  As usual, speak up 
> if you'd like to see it promoted to a fasttrack.

+1, it seems obvious enough.

    - Garrett

>
> liane
>
> ---
>
> tcp_keepalive For inetd Services
> Gary Mills
> 08/27/2009
>
> 1. Summary
>
> The inetd restarter defines a set of properties to control the 
> behaviour of the services it manages.  This case adds the option 
> `tcp_keepalive' to the inetd restarter.  Setting this option enables 
> the TCP keepalive facility for connections to services managed by 
> inetd.  It's needed because some services do not have the ability to 
> enable this facility by themselves.
>
> This property is set to false by default for inetd services, and the 
> stability is Committed.
>
> 2. Manpage diffs
>
> *** inetd.Ocat    Wed Aug 26 16:39:12 2009
> --- inetd.cat    Wed Aug 26 16:40:32 2009
> ***************
> *** 473,478 ****
> --- 473,487 ----
>            set to true.
>
>
> +      tcp_keepalive
> +
> +          If true, enable the periodic transmission of messages on
> +          a  connected  socket.  If  the  connected party fails to
> +          respond to these  messages,  the  connection   is   con-
> +          sidered  broken.  This  applies  only  to  services with
> +          endpoint_type set to streams and wait set to false.
> +
> +
>        tcp_trace
>
>            If true, and this is a nowait-type service,  inetd  logs
> ***************
> *** 566,571 ****
> --- 575,581 ----
>          inherit_env         true
>          max_con_rate        -1
>          max_copies          -1
> +        tcp_keepalive       false
>          tcp_trace           false
>          tcp_wrappers        false


From Nicolas.Williams@sun.com Fri Aug 28 15:50:04 2009
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7SMo3XH009502
	for <psarc-ext@sac.sfbay.sun.com>; Fri, 28 Aug 2009 15:50:03 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id n7SMnuYH016824;
	Sat, 29 Aug 2009 06:49:57 +0800 (SGT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP300201ZF83O00@brm-avmta-1.central.sun.com>; Fri,
 28 Aug 2009 16:49:56 -0600 (MDT)
Received: from binky.Central.Sun.COM ([129.153.128.104])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP300C3CZF7XB90@brm-avmta-1.central.sun.com>; Fri,
 28 Aug 2009 16:49:55 -0600 (MDT)
Received: from binky.Central.Sun.COM (localhost [127.0.0.1])
	by binky.Central.Sun.COM (8.14.3+Sun/8.14.3) with ESMTP id n7SMd3DQ006054;
 Fri, 28 Aug 2009 17:39:03 -0500 (CDT)
Received: (from nw141292@localhost)
	by binky.Central.Sun.COM (8.14.3+Sun/8.14.3/Submit) id n7SMd30t006053; Fri,
 28 Aug 2009 17:39:03 -0500 (CDT)
Date: Fri, 28 Aug 2009 17:39:03 -0500
From: Nicolas Williams <Nicolas.Williams@sun.com>
Subject: Re: 2009/470 tcp_keepalive For inetd Services
In-reply-to: <4A985655.8080705@sun.com>
To: Andrew Gabriel <Andrew.Gabriel@sun.com>
Cc: Liane Praza <Liane.Praza@sun.com>, PSARC-ext@sun.com,
        mills@cc.umanitoba.ca, Sean Wilcox <swilcox@sun.com>
Message-id: <20090828223903.GD1033@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
References: <4A984D64.6070501@sun.com> <4A985655.8080705@sun.com>
X-Authentication-warning: binky.Central.Sun.COM: nw141292 set sender to
 Nicolas.Williams@sun.com using -f
User-Agent: Mutt/1.5.7i
Status: RO
Content-Length: 1334

On Fri, Aug 28, 2009 at 11:12:37PM +0100, Andrew Gabriel wrote:
> This is quite different from any of the existing inetd configuration 
> parameters - inetd doesn't currently allow manipulation of socket 
> configuration parameters.

But maybe it should.  There's a large variety of potentially useful
socket options to use, including IP_SEC_OPT (on listening sockets).

> Please can you describe a case where this is intended to be used? (I 
> ask, because mostly whenever I do see it being used, the author 
> misunderstood what it does and shouldn't have been using it.)

The thread on networking-discuss made it clear: it's for use with
protocols like TELNET and rlogin where there's no app-layer keepalive
(compare to SSHv2, where we have app-layer keepalive features; see
ClientAlive, ServerAlive, and related ssh_config/sshd_config options).

As with all keepalives this is to... keep idle connections alive.

> Why do you intend to allow access to this socket parameter, but no 
> others (such as SO_SNDBUF, SO_RCVBUF, etc)?

I asked about that too.  I'd like to see the keepalive timer interface
set this way too.  But I don't think this case is so incomplete without
those that it should be TCR'ed to add them.  I think this is a great
OpenSolaris contribution story.

[Note: I'm not part of the i-team.]

Cheers,

Nico
-- 

From mills@cc.umanitoba.ca Fri Aug 28 18:25:35 2009
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7T1PZJj020773
	for <psarc-ext@sac.sfbay.sun.com>; Fri, 28 Aug 2009 18:25:35 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail2sca.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n7T1PW42014755;
	Fri, 28 Aug 2009 18:25:32 -0700 (PDT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP400M036MK9B00@nwk-avmta-1.sfbay.Sun.COM>; Fri,
 28 Aug 2009 18:25:32 -0700 (PDT)
Received: from brmea-mail-2.sun.com ([192.18.98.43])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP400E716MK1O50@nwk-avmta-1.sfbay.Sun.COM>; Fri,
 28 Aug 2009 18:25:32 -0700 (PDT)
Received: from relay43i.sun.com ([192.5.209.74])
	by brmea-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n7T1G4vZ006561; Sat,
 29 Aug 2009 01:25:32 +0000 (GMT)
Received: from mmp42es.mmp.us.syntegra.com ([160.41.221.11] [160.41.221.11])
 by relay43i.sun.com with ESMTP id BT-MMP-125850; Sat,
 29 Aug 2009 01:25:31 +0000 (Z)
Received: from relay41i.sun.com (relay41i.sun.com [192.5.209.70])
 by mmp42es.mmp.us.syntegra.com with ESMTP id BT-MMP-635131; Sat,
 29 Aug 2009 01:25:28 +0000 (Z)
Received: from electra.cc.umanitoba.ca ([130.179.16.34] [130.179.16.34])
 by relay4i.sun.com with ESMTP id BT-MMP-874420; Sat,
 29 Aug 2009 01:25:28 +0000 (Z)
Received: from deneb.cc.umanitoba.ca
 (mills@deneb.cc.umanitoba.ca [130.179.16.69])	by electra.cc.umanitoba.ca
 (8.14.2/8.14.2) with ESMTP id n7T1PRDV020332; Fri,
 28 Aug 2009 20:25:27 -0500 (CDT)
Received: (from mills@localhost)	by deneb.cc.umanitoba.ca (8.13.8+Sun/8.12.2)
 id n7T1PRgh023368; Fri, 28 Aug 2009 20:25:27 -0500 (CDT)
Content-return: prohibited
Date: Fri, 28 Aug 2009 20:25:27 -0500
From: Gary Mills <mills@cc.umanitoba.ca>
Subject: Re: 2009/470 tcp_keepalive For inetd Services
In-reply-to: <4A985655.8080705@sun.com>
To: Andrew Gabriel <Andrew.Gabriel@sun.com>
Cc: Liane Praza <Liane.Praza@sun.com>, PSARC-ext@sun.com,
        Sean Wilcox <swilcox@sun.com>
Message-id: <20090829012527.GA21625@cc.umanitoba.ca>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-DCC-UofM-Metrics: electra; whitelist
X-Antispam: No, score=-2.6/5.0, scanned in 3.250sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <4A984D64.6070501@sun.com> <4A985655.8080705@sun.com>
User-Agent: Mutt/1.5.10i
Status: RO
Content-Length: 2477

On Fri, Aug 28, 2009 at 11:12:37PM +0100, Andrew Gabriel wrote:
> Liane Praza wrote:
> >I'm filing this case for Gary as closed-approved-automatic, as it seems 
> >an obvious extension to existing interface.  As usual, speak up if you'd 
> >like to see it promoted to a fasttrack.
> >
> >tcp_keepalive For inetd Services
> >Gary Mills
> >08/27/2009
> >
> >1. Summary
> >
> >The inetd restarter defines a set of properties to control the behaviour 
> >of the services it manages.  This case adds the option `tcp_keepalive' 
> >to the inetd restarter.  Setting this option enables the TCP keepalive 
> >facility for connections to services managed by inetd.  It's needed 
> >because some services do not have the ability to enable this facility by 
> >themselves.
> 
> This is quite different from any of the existing inetd configuration 
> parameters - inetd doesn't currently allow manipulation of socket 
> configuration parameters.
> Please can you describe a case where this is intended to be used? (I 
> ask, because mostly whenever I do see it being used, the author 
> misunderstood what it does and shouldn't have been using it.)
> Why do you intend to allow access to this socket parameter, but no 
> others (such as SO_SNDBUF, SO_RCVBUF, etc)?

We've been using the keepalive option for some time, both on Solaris 9
and Solaris 10, through a wrapper, only for telnet and rlogin.  That's
because we have a firewall that disconnects idle sessions after one
hour.  This works without complaints for HTTP connections but is
extremely annoying for the few terminal connections that exist.  The
telnet and rlogin servers have no way to enable keepalives at any
level.  Yes, you can say that doing that is a misuse of the facility,
although I'd prefer to call it a clever use.  Bug 6263835, initiated
by me, suggests adding the option to inetd so that the wrapper would
no longer be necessary.

My webrev is at: http://cr.opensolaris.org/~jgmills/ws-6263835/

Yes, there are many other TCP options that inetd could set.  In fact,
I expected that to be one of the objections.  I didn't think that we
wanted to make all of them available in the inetd configuration,
unless we had some justification for doing that.  In fact, there are
so many of them that we'd have to devise a language for them, rather
than adding all of them as separate options to inetd.  I didn't want
to open that can of worms.

-- 
-Gary Mills-        -Unix Group-        -Computer and Network Services-

From Andrew.Gabriel@sun.com Sat Aug 29 00:56:51 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7T7uotu012051
	for <psarc-ext@sac.sfbay.sun.com>; Sat, 29 Aug 2009 00:56:50 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n7T7umsb017440
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Sat, 29 Aug 2009 08:56:49 +0100 (BST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP400703OQN4C00@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sat, 29 Aug 2009 00:56:47 -0700 (PDT)
Received: from gmp-eb-inf-2.sun.com ([192.18.6.24])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP400L1VOQM7T70@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Sat,
 29 Aug 2009 00:56:47 -0700 (PDT)
Received: from fe-emea-10.sun.com
 (gmp-eb-lb-1-fe1.eu.sun.com [192.18.6.7] (may be forged))
	by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n7T7ukLu024068	for
 <PSARC-ext@sun.com>; Sat, 29 Aug 2009 07:56:46 +0000 (GMT)
Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KP400A00OE6QS00@fe-emea-10.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sat, 29 Aug 2009 08:56:21 +0100 (BST)
Received: from [81.187.162.109] ([unknown] [81.187.162.109])
 by fe-emea-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KP4000YCOPXUXC0@fe-emea-10.sun.com>; Sat,
 29 Aug 2009 08:56:21 +0100 (BST)
Date: Sat, 29 Aug 2009 08:56:25 +0100
From: Andrew Gabriel <Andrew.Gabriel@sun.com>
Subject: Re: 2009/470 tcp_keepalive For inetd Services
In-reply-to: <20090829012527.GA21625@cc.umanitoba.ca>
Sender: Andrew.Gabriel@sun.com
To: Gary Mills <mills@cc.umanitoba.ca>
Cc: Liane Praza <Liane.Praza@sun.com>, PSARC-ext@sun.com,
        Sean Wilcox <swilcox@sun.com>
Message-id: <4A98DF29.3030208@sun.com>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <4A984D64.6070501@sun.com> <4A985655.8080705@sun.com>
 <20090829012527.GA21625@cc.umanitoba.ca>
User-Agent: Thunderbird 2.0.0.21 (X11/20090323)
Status: RO
Content-Length: 1939

Gary Mills wrote:
> 
> We've been using the keepalive option for some time, both on Solaris 9
> and Solaris 10, through a wrapper, only for telnet and rlogin.  That's
> because we have a firewall that disconnects idle sessions after one
> hour.  This works without complaints for HTTP connections but is
> extremely annoying for the few terminal connections that exist.  The
> telnet and rlogin servers have no way to enable keepalives at any
> level.  Yes, you can say that doing that is a misuse of the facility,
> although I'd prefer to call it a clever use.  Bug 6263835, initiated
> by me, suggests adding the option to inetd so that the wrapper would
> no longer be necessary.

As you say, it's a clever misuse of the facility, but that's OK.
(It's a shame a firewall behaving in this way doesn't fake up its own 
keepalives, shortly before it clears out the connection state.)

I would suggest some more guidance on it's use on the manpage, aimed at 
sysadmin rather than networking expert level, because in most cases the 
use of tcp keepalive actually does the exact opposite, and ensures death 
of connections which would otherwise have not died (the naming is 
somewhat misleading). Consider addition of something like:

         This parameter may be useful to preserve idle
         connections through a stateful firewall which
         implements a short timeout, and it may be useful
         to closedown connections from clients which fail
         to closedown their connections when powered off.
         However, it may cause idle connections to be
         broken during periods of transitory network
         outage, which would have survived the outage in
         the absence of this parameter.

It's this last part which catches people out -- the parameter causes
death to connections during transitory network problems, which is 
completely contrary to what you might assume from the parameter name.

-- 
Andrew

From mills@cc.umanitoba.ca Sat Aug 29 06:37:46 2009
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7TDbkLM024046
	for <psarc-ext@sac.sfbay.sun.com>; Sat, 29 Aug 2009 06:37:46 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n7TDbhN2018247;
	Sat, 29 Aug 2009 07:37:44 -0600 (MDT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP5007034IVDS00@nwk-avmta-1.sfbay.Sun.COM>; Sat,
 29 Aug 2009 06:37:43 -0700 (PDT)
Received: from sca-ea-mail-2.sun.com ([192.18.43.25])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP500A8H4IUUF40@nwk-avmta-1.sfbay.Sun.COM>; Sat,
 29 Aug 2009 06:37:42 -0700 (PDT)
Received: from relay43i.sun.com ([192.5.209.74])
	by sca-ea-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n7TDbfbL019795;
 Sat, 29 Aug 2009 13:37:42 +0000 (GMT)
Received: from mmp42es.mmp.us.syntegra.com ([160.41.221.11] [160.41.221.11])
 by relay43i.sun.com with ESMTP id BT-MMP-151164; Sat,
 29 Aug 2009 13:37:41 +0000 (Z)
Received: from relay45i.sun.com (relay45i.sun.com [192.5.209.94])
 by mmp42es.mmp.us.syntegra.com with ESMTP id BT-MMP-1498104; Sat,
 29 Aug 2009 13:37:41 +0000 (Z)
Received: from electra.cc.umanitoba.ca ([130.179.16.34] [130.179.16.34])
 by relay4i.sun.com with ESMTP id BT-MMP-2034501; Sat,
 29 Aug 2009 13:37:40 +0000 (Z)
Received: from deneb.cc.umanitoba.ca
 (mills@deneb.cc.umanitoba.ca [130.179.16.69])	by electra.cc.umanitoba.ca
 (8.14.2/8.14.2) with ESMTP id n7TDbcvn002828; Sat,
 29 Aug 2009 08:37:38 -0500 (CDT)
Received: (from mills@localhost)	by deneb.cc.umanitoba.ca (8.13.8+Sun/8.12.2)
 id n7TDbcMR000550; Sat, 29 Aug 2009 08:37:38 -0500 (CDT)
Content-return: prohibited
Date: Sat, 29 Aug 2009 08:37:38 -0500
From: Gary Mills <mills@cc.umanitoba.ca>
Subject: Re: 2009/470 tcp_keepalive For inetd Services
In-reply-to: <4A98DF29.3030208@sun.com>
To: Andrew Gabriel <Andrew.Gabriel@sun.com>
Cc: Liane Praza <Liane.Praza@sun.com>, PSARC-ext@sun.com,
        Sean Wilcox <swilcox@sun.com>
Message-id: <20090829133737.GA28234@cc.umanitoba.ca>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-DCC-UofM-Metrics: electra; whitelist
X-Antispam: No, score=-0.2/5.0, scanned in 0.092sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <4A984D64.6070501@sun.com> <4A985655.8080705@sun.com>
 <20090829012527.GA21625@cc.umanitoba.ca> <4A98DF29.3030208@sun.com>
User-Agent: Mutt/1.5.10i
Status: RO
Content-Length: 2324

On Sat, Aug 29, 2009 at 08:56:25AM +0100, Andrew Gabriel wrote:
> 
> I would suggest some more guidance on it's use on the manpage, aimed at 
> sysadmin rather than networking expert level, because in most cases the 
> use of tcp keepalive actually does the exact opposite, and ensures death 
> of connections which would otherwise have not died (the naming is 
> somewhat misleading). Consider addition of something like:
> 
>         This parameter may be useful to preserve idle
>         connections through a stateful firewall which
>         implements a short timeout, and it may be useful
>         to closedown connections from clients which fail
>         to closedown their connections when powered off.
>         However, it may cause idle connections to be
>         broken during periods of transitory network
>         outage, which would have survived the outage in
>         the absence of this parameter.
> 
> It's this last part which catches people out -- the parameter causes
> death to connections during transitory network problems, which is 
> completely contrary to what you might assume from the parameter name.

That's certainly acceptable to me.  I don't know how much guidance
to sysadmins should be included in man pages, but in this case the
name is indeed misleading.  I'll add that to the ARC materials.

Now, here come the worms: I've had a number of requests to add
per-socket keepalive timeouts.  I agree that this is a reasonable
thing to do, since they go along nicely with setting SO_KEEPALIVE.
In fact, I wondered how I had overlooked those settings in my wrapper
for Solaris 9 and Solaris 10.  It turns out that they don't exist
there!  For snv_121 in /usr/include/netinet/tcp.h there are:

    #define TCP_KEEPALIVE_THRESHOLD         0x16
    #define TCP_KEEPALIVE_ABORT_THRESHOLD   0x17

Now that I know what to change in the inetd code, I can easily add two
more TCP settings.  People have only asked for the first one.  Should
I add one or both or none?

What happens with a back-port to Solaris 10?  I can `ifdef' them in
the C source, but not in the XML file or man page.  Alternatively, I
can leave them in for Solaris 10 but have them do nothing if the
symbols don't exist.  What do you recommend?

-- 
-Gary Mills-        -Unix Group-        -Computer and Network Services-

From casper@holland.sun.com Mon Aug 31 01:19:01 2009
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n7V8J0dx026822
	for <psarc-ext@sac.sfbay.sun.com>; Mon, 31 Aug 2009 01:19:01 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id n7V8Ia0I024900;
	Mon, 31 Aug 2009 16:18:57 +0800 (SGT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KP800803F3JIJ00@nwk-avmta-1.sfbay.Sun.COM>; Mon,
 31 Aug 2009 01:18:55 -0700 (PDT)
Received: from dm-holland-02.uk.sun.com ([129.156.101.225])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KP8006TNF3I4230@nwk-avmta-1.sfbay.Sun.COM>; Mon,
 31 Aug 2009 01:18:55 -0700 (PDT)
Received: from holland (room101.Holland.Sun.COM [10.16.117.40])
	by dm-holland-02.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2)
 with ESMTP id n7V8Ion4036007; Mon, 31 Aug 2009 09:18:50 +0100 (BST)
Date: Mon, 31 Aug 2009 10:18:50 +0200
From: Casper.Dik@sun.com
Subject: Re: 2009/470 tcp_keepalive For inetd Services
In-reply-to: <20090828223903.GD1033@Sun.COM>
Sender: casper@holland.sun.com
To: Nicolas Williams <Nicolas.Williams@sun.com>
Cc: Andrew Gabriel <Andrew.Gabriel@sun.com>, Liane Praza <Liane.Praza@sun.com>,
        PSARC-ext@sun.com, mills@cc.umanitoba.ca,
        Sean Wilcox <swilcox@sun.com>
Message-id: <200908310818.n7V8Ion4036007@dm-holland-02.uk.sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <4A984D64.6070501@sun.com> <4A985655.8080705@sun.com>
 <20090828223903.GD1033@Sun.COM>
Status: RO
Content-Length: 1658


>On Fri, Aug 28, 2009 at 11:12:37PM +0100, Andrew Gabriel wrote:
>> This is quite different from any of the existing inetd configuration 
>> parameters - inetd doesn't currently allow manipulation of socket 
>> configuration parameters.
>
>But maybe it should.  There's a large variety of potentially useful
>socket options to use, including IP_SEC_OPT (on listening sockets).

I concur.  

I wrote a prototype for the following setsockoptions:

        - SOL_SOCKET, SO_KEEPALIVE, Boolean
        - SOL_SOCKET, SO_RCVBUF, Integer
        - SOL_SOCKET, SO_SNDBUF, Integer
        - SOL_SOCKET, SO_ALLZONES, Boolean
        - SOL_SOCKET, SO_RECVUCRED, Boolean
        - SOL_SOCKET, SO_TIMESTAMP, Boolean
        - SOL_SOCKET, SO_REUSEADDR, Boolean (already implemented: fixed as true)

        - IPPROTO_IP, IP_RECVDSTADDR, Boolean
        - IPPROTO_IP, IP_RECVOPTS, Boolean
        - IPPROTO_IP, IP_RECVIF, Boolean
        - IPPROTO_IP, IP_RECVSLLA, Boolean
        - IPPROTO_IP, IP_RECVTTL, Boolean

        - IPPROTO_IPV6, IPV6_RECVPKTINFO, Boolean
        - IPPROTO_IPV6, IPV6_RECVTCLASS, Boolean
        - IPPROTO_IPV6, IPV6_RECVPATHMTU, Boolean
        - IPPROTO_IPV6, IPV6_RECVHOPLIMIT, Boolean
        - IPPROTO_IPV6, IPV6_RECVHOPOPTS, Boolean
        - IPPROTO_IPV6, IPV6_RECVDSTOPTS, Boolean
        - IPPROTO_IPV6, IPV6_RECVRTHDR, Boolean
        - IPPROTO_IPV6, IPV6_RECVRTHDRDSTOPTS, Boolean
        - IPPROTO_IPV6, IPV6_V6ONLY, Boolean  (already implemented)


>As with all keepalives this is to... keep idle connections alive.

And to detect broken connections.  If the client goes away, the server 
wants to tear down the sessions.


Casper


From liane.praza@sun.com Wed Oct  7 21:59:14 2009
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n984xEIj019662
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 7 Oct 2009 21:59:14 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail2sca.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4) with ESMTP id n984xCxL027269;
	Wed, 7 Oct 2009 21:59:13 -0700 (PDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KR600A05J6O7B00@brm-avmta-1.central.sun.com>; Wed,
 07 Oct 2009 22:59:13 -0600 (MDT)
Received: from jurassic-x4600.sfbay.sun.com ([129.146.17.59])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KR600LSWJ6OIRV3@brm-avmta-1.central.sun.com>; Wed,
 07 Oct 2009 22:59:12 -0600 (MDT)
Received: from [10.7.251.216] (punchin-lianep.SFBay.Sun.COM [10.7.251.216])
	by jurassic-x4600.sfbay.sun.com (8.14.3+Sun/8.14.3)
 with ESMTP id n984xB3U659404; Wed, 07 Oct 2009 21:59:11 -0700 (PDT)
Date: Wed, 07 Oct 2009 21:59:11 -0700
From: Liane Praza <liane.praza@sun.com>
Subject: Re: 2009/470 tcp_keepalive For inetd Services
In-reply-to: <4A984D64.6070501@sun.com>
To: PSARC-ext@sun.com
Cc: mills@cc.umanitoba.ca, Sean Wilcox <swilcox@sun.com>
Message-id: <4ACD719F.2000606@sun.com>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <4A984D64.6070501@sun.com>
User-Agent: Thunderbird 2.0.0.22 (X11/20090909)
Status: RO
Content-Length: 1145

Liane Praza wrote:
> I'm filing this case for Gary as closed-approved-automatic, as it seems 
> an obvious extension to existing interface.  As usual, speak up if you'd 
> like to see it promoted to a fasttrack.

BTW, just to close the loop on this one after the discussion... Gary 
would like to go ahead with the work as it was initially specified, 
and there seems to be general support for that from a number of 
folks including at least one voting ARC member. (There will be 
clarifications to the manpage, as requested, and that will be worked 
as part of the manpage bug.  It doesn't change the substance of this 
case.)

It's a straightforward feature, and the work could obviously be 
extended in the future (with a new case) to other options if 
desired/justified.  But without the real customer requests to 
justify the additions, Gary would like to proceed with the explicit 
option he understands the use case for.  I agree, and think we 
should leave this case closed as initially specified.

If there are specific objections, please raise them ASAP, otherwise 
Gary will move to integrating his changes after a day or two.

liane

