From owner-freebsd-rc@freebsd.org Mon Aug 22 13:30:50 2016 Return-Path: Delivered-To: freebsd-rc@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 605A5BC1F05 for ; Mon, 22 Aug 2016 13:30:50 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 241AF131F for ; Mon, 22 Aug 2016 13:30:49 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id A61C528426; Mon, 22 Aug 2016 15:30:41 +0200 (CEST) Received: from illbsd.quip.test (ip-86-49-16-209.net.upcbroadband.cz [86.49.16.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id D14FD28412; Mon, 22 Aug 2016 15:30:40 +0200 (CEST) Message-ID: <57BAFE80.3050501@quip.cz> Date: Mon, 22 Aug 2016 15:30:40 +0200 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:35.0) Gecko/20100101 Firefox/35.0 SeaMonkey/2.32 MIME-Version: 1.0 To: Zeus Panchenko , freebsd-rc@freebsd.org Subject: Re: how to start sshd just after network initialization? ... References: <20160822160651.88181@relay.ibs.dn.ua> In-Reply-To: <20160822160651.88181@relay.ibs.dn.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 13:30:50 -0000 Zeus Panchenko wrote on 08/22/2016 15:06: > hi, > > what is the best way to guarantee scripts starting order? > > I need sshd start first and squid start last among all scripts which are starting > > is the only way to put (for example) to /usr/local/etc/rc.d/ script/s > to order it? > > so, to just start squid after sshd I need something like this: > > ---[ /usr/local/etc/rc.d/ORDER1 start ]--- > > #!/bin/sh > # > > # PROVIDE: precedence > # REQUIRE: sshd > # BEFORE: squid > > ---[ /usr/local/etc/rc.d/ORDER1 stop ]--- > > > but how to configure it globally to start sshd just after network initialization? > is it something like this? > > ---[ /usr/local/etc/rc.d/ORDER0 start ]--- > > #!/bin/sh > # > > # PROVIDE: precedence > # REQUIRE: NETWORKING pf pflog > # BEFORE: sshd > > ---[ /usr/local/etc/rc.d/ORDER0 stop ]--- > > is there some other way to order them? I had similar requirements so I had this /usr/local/etc/rc.d/sshd_reorder #!/bin/sh # PROVIDE: sshd_reorder # REQUIRE: LOGIN sshd ## this file is just to start sshd earlier on the boot ## mainly before long starting processes like jails, mysql, apache etc. ## ## place this file in to /usr/local/etc/rc.d/sshd_reorder ## and make it executable chmod 0555 /usr/local/etc/rc.d/sshd_reorder I don't know when Squid starts (I don't use it) so you can look in to output of rcorder /etc/rc.d/* /usr/local/etc/rc.d/* and use NETWORKING alone or some more specific Miroslav Lachman