From owner-freebsd-stable@freebsd.org Wed Sep 23 15:23:45 2015 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FCB1A07E09 for ; Wed, 23 Sep 2015 15:23:45 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 80CCE1F71 for ; Wed, 23 Sep 2015 15:23:45 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 7DF2CA07E07; Wed, 23 Sep 2015 15:23:45 +0000 (UTC) Delivered-To: stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D8E7A07E06 for ; Wed, 23 Sep 2015 15:23:45 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com [IPv6:2607:f8b0:4003:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 467751F70 for ; Wed, 23 Sep 2015 15:23:45 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by oiww128 with SMTP id w128so25654526oiw.2 for ; Wed, 23 Sep 2015 08:23:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=H2M6DGjnBqUj/k41UZhuwRarBdHBwu0Gth/MkkraSIM=; b=IHqpIymiIWYzPyxCYT9SR706PzewSXqdo0FB1SRIqny/HGpbS/fzuEBid+tlNXTdjw K4eTiapHEqJ66rehIwULmUMb8jD2uAZmIxFDhcgCivuj4ZcQpyOSAJzKEjLXt3raBu24 PV9RoVBVMgxMx1H7IqiuvJ/tIm/S/uEPE8EAGZ4Ga+E38seUKP2fAOpF4uElqRuNXACM jn45g3QxD0vA9dV5sCFo7SIei0TcYuvQsdH4veImnTCWvoVKuTecBHtFVds+z7Nm3C0X 4T3qJsFbrLvLrg8lvVdGTyY/3Q5/KQlavqwv3JRzFqvl14mYH5qlfcYHnlv6B2vIL+kG sItg== MIME-Version: 1.0 X-Received: by 10.202.80.83 with SMTP id e80mr18567711oib.51.1443021824573; Wed, 23 Sep 2015 08:23:44 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.79.9 with HTTP; Wed, 23 Sep 2015 08:23:44 -0700 (PDT) In-Reply-To: <8CC54339-0028-4CE4-9AAD-2248CD4E2FC9@lafn.org> References: <56026686.8030308@norma.perm.ru> <8CC54339-0028-4CE4-9AAD-2248CD4E2FC9@lafn.org> Date: Wed, 23 Sep 2015 09:23:44 -0600 X-Google-Sender-Auth: yyFMr4tPN7fHv-va2pjjo__qHbc Message-ID: Subject: Re: when the sshd hits the fan From: Alan Somers To: Doug Hardie Cc: FreeBSD Stable ML Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2015 15:23:45 -0000 On Wed, Sep 23, 2015 at 3:57 AM, Doug Hardie wrote: > >> On 23 September 2015, at 01:44, Eugene M. Zheganin w= rote: >> >> Hi. >> >> I'm trying to understand why the sshd still starts after local daemons, >> out-of-the-box, and what it takes to make this extremely vital service >> to start before non-system (local) ones. I bet I'm not the first one to >> ask, so why isn't this already done ? Seems quite easy for me. > > The fix is quite simple: Add > > # BEFORE: mail > > to /etc/rc.d/sshd > > I tried to submit a PR on that about a year ago, but it never seemed to m= ake it into the PR system. Many of my servers are remote and if there is a= n issue with a port, I still need a way into the system other than driving = for hours. This works. Sshd is started early in the sequence and I can at= least ssh into the server. It won=E2=80=99t help though if there is a syn= tax error in /etc/rc.conf. Those are pretty much fatal. > This technique works. But if you use it, then before you reboot, remember to run "rcorder /etc/rc.d/* /usr/local/etc/rc.d/*" and make sure there aren't any errors about "Circular dependency". If there are, then the service startup order is almost guaranteed to be something you don't want. -Alan