From wollman@khavrinen.lcs.mit.edu  Tue Nov 26 11:17:47 2002
Return-Path: <wollman@khavrinen.lcs.mit.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8130537B401
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 26 Nov 2002 11:17:47 -0800 (PST)
Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C224A43EB2
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 26 Nov 2002 11:17:46 -0800 (PST)
	(envelope-from wollman@khavrinen.lcs.mit.edu)
Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1])
	by khavrinen.lcs.mit.edu (8.12.6/8.12.6) with ESMTP id gAQJHjlI017292
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK)
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 26 Nov 2002 14:17:45 -0500 (EST)
	(envelope-from wollman@khavrinen.lcs.mit.edu)
Received: (from root@localhost)
	by khavrinen.lcs.mit.edu (8.12.6/8.12.6/Submit) id gAQJHjBf017291;
	Tue, 26 Nov 2002 14:17:45 -0500 (EST)
	(envelope-from wollman)
Message-Id: <200211261917.gAQJHjBf017291@khavrinen.lcs.mit.edu>
Date: Tue, 26 Nov 2002 14:17:45 -0500 (EST)
From: Garrett Wollman <wollman@lcs.mit.edu>
Reply-To: Garrett Wollman <wollman@lcs.mit.edu>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: rcNG broke non-system sshd startup
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         45766
>Category:       conf
>Synopsis:       rcNG broke non-system sshd startup
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mtm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 26 11:20:01 PST 2002
>Closed-Date:    Sat Jul 12 18:59:53 PDT 2003
>Last-Modified:  Sat Jul 12 18:59:53 PDT 2003
>Originator:     Garrett Wollman
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
MIT Laboratory for Computer Science
>Environment:
System: FreeBSD khavrinen.lcs.mit.edu 5.0-CURRENT FreeBSD 5.0-CURRENT #609: Mon Nov 25 16:08:14 EST 2002 root@:/usr/src/sys/i386/compile/KHAVRINEN i386

     $NetBSD: sshd,v 1.18 2002/04/29 08:23:34 lukem Exp $
     $FreeBSD: src/etc/rc.d/sshd,v 1.2 2002/06/13 22:14:36 gordon Exp $

>Description:
	/etc/rc.d/sshd checks for the presence of a configuration file
	which is only used by the system sshd.  Systems which use another
	sshd and have the system sshd disabled in the build will not have
	this configuration file.  This breaks a previously working
	configuration.

>How-To-Repeat:
	Update to a recent -current, run mergemaster, and reboot.
	Try to log in remotely and note that sshd is not running.
>Fix:

I made this change to fix it (which also disables some other brokenness in
this script).  My feeling in general is that startup scripts should not try
to outsmart the program they are starting; if the configuration file doesn't
exist, then it is right and proper for the program to fail with its own
error message rather than being second-guessed by the startup script.

Index: sshd
===================================================================
RCS file: /home/cvs/src/etc/rc.d/sshd,v
retrieving revision 1.2
diff -u -r1.2 sshd
--- sshd        13 Jun 2002 22:14:36 -0000      1.2
+++ sshd        26 Nov 2002 19:08:06 -0000
@@ -12,12 +12,11 @@
 
 name="sshd"
 rcvar=`set_rcvar`
-command="/usr/sbin/${name}"
 keygen_cmd="sshd_keygen"
-start_precmd="sshd_precmd"
+#start_precmd="sshd_precmd"
 pidfile="/var/run/${name}.pid"
-required_files="/etc/ssh/sshd_config"
-extra_commands="keygen reload"
+#required_files="/etc/ssh/sshd_config"
+#extra_commands="keygen reload"
 
 sshd_keygen()
 {


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mtm 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Jul 12 16:41:13 PDT 2003 
Responsible-Changed-Why:  
Over to rcng maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45766 
State-Changed-From-To: open->closed 
State-Changed-By: mtm 
State-Changed-When: Sat Jul 12 18:49:38 PDT 2003 
State-Changed-Why:  
I have committed a patch that no longer makes the configuration 
file a requirement. This should allow a third party sshd to be 
started from the script. As for the rest of the changes in 
the patch, we shouldn't disable functionality for users of the 
base ssh (used by the majority of our users) to accomodate 
third party sshd. 

In the long run I think we need an rc.d for the ports system 
and completely dissassociate /etc/rc.d scripts from having 
to start third party apps. In the mean time though rev. 1.3 
of src/etc/rc.d/sshd should allow you to start the sshd of your 
choice. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45766 
>Unformatted:
