From owner-freebsd-stable@freebsd.org Wed Aug 19 09:05:09 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 31D3A9BDDAC for ; Wed, 19 Aug 2015 09:05:09 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 E3B6E2F for ; Wed, 19 Aug 2015 09:05:08 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZRzIw-0004o0-AP; Wed, 19 Aug 2015 12:05:06 +0300 Date: Wed, 19 Aug 2015 12:05:06 +0300 From: Slawa Olhovchenkov To: Marko =?koi8-r?Q?Cupa'c?= Cc: FreeBSD stable Subject: Re: best way to restart process Message-ID: <20150819090506.GH3158@zxy.spb.ru> References: <20150819103747.5c2ef288@efreet> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20150819103747.5c2ef288@efreet> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false 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, 19 Aug 2015 09:05:09 -0000 On Wed, Aug 19, 2015 at 10:37:47AM +0200, Marko Cupa'c wrote: > Hi, > > I am trying to setup diskless client whose only purpose is logging > of one user with permanent password into single RDP server via xfreerdp. > I know how to setup autostart of xfreerdp, but I don't know how to > restart if it exits for some reason (network problems etc.) > > What is the best way to check if process is running and restart it if > it exits? DAEMON(8) FreeBSD System Manager's Manual DAEMON(8) NAME daemon - run detached from the controlling terminal SYNOPSIS daemon [-cfr] [-p child_pidfile] [-P supervisor_pidfile] [-u user] command arguments ... DESCRIPTION [...] -r Supervise and restart the program if it has been terminated.