From owner-freebsd-questions@freebsd.org Wed Apr 12 19:10:46 2017 Return-Path: Delivered-To: freebsd-questions@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 01D64D3B071 for ; Wed, 12 Apr 2017 19:10:45 +0000 (UTC) (envelope-from steve@sohara.org) Received: from smtp1.irishbroadband.ie (smtp2.irishbroadband.ie [62.231.32.43]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD4287BE for ; Wed, 12 Apr 2017 19:10:45 +0000 (UTC) (envelope-from steve@sohara.org) Received: from [89.127.62.20] (helo=smtp.lan.sohara.org) by smtp1.irishbroadband.ie with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1cyNf1-0003bn-10; Wed, 12 Apr 2017 20:10:35 +0100 Received: from [192.168.63.1] (helo=steve.lan.sohara.org) by smtp.lan.sohara.org with smtp (Exim 4.88 (FreeBSD)) (envelope-from ) id 1cyNfu-0000dX-Ts; Wed, 12 Apr 2017 19:11:30 +0000 Date: Wed, 12 Apr 2017 20:10:29 +0100 From: Steve O'Hara-Smith To: byrnejb@harte-lyne.ca Cc: "James B. Byrne via freebsd-questions" Subject: Re: Q. How to script a self checking starting rc.d script Message-Id: <20170412201029.48428d98b592b9f963b1423d@sohara.org> In-Reply-To: <740265b61597d745421e95e190c659d8.squirrel@webmail.harte-lyne.ca> References: <740265b61597d745421e95e190c659d8.squirrel@webmail.harte-lyne.ca> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.29; amd64-portbld-freebsd10.3) X-Clacks-Overhead: "GNU Terry Pratchett" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 19:10:46 -0000 On Wed, 12 Apr 2017 14:25:36 -0400 "James B. Byrne via freebsd-questions" wrote: > We are moving from RHEL/CentOS Linux to FreeBSD. On one of our Linux > boxes we currently have an ssh pipe to a remote imap service. This is > a straight-forward ssh tunnel. In the past there have been > circumstances where this connection has failed. In order to > automatically re-establish the pipe I wrote an 'upstart' job to set up > the pipe and automatically restart after a stoppage. > > How is this sort of thing handled in FreeBSD? Through cron monitoring? For this particular job I would suggest using autossh started in rc.local or with a minimal rc script in /usr/local/etc/rc.d which you'd have to write - personally I'd go with rc.local. -- Steve O'Hara-Smith