From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 2820A1381F3 for ; Fri, 10 May 2013 04:18:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B54A6E08CE; Fri, 10 May 2013 04:18:04 +0000 (UTC) Received: from smtpout.karoo.kcom.com (smtpout.karoo.kcom.com [212.50.160.34]) by pigeon.gentoo.org (Postfix) with ESMTP id AFCFEE0801 for ; Fri, 10 May 2013 04:18:03 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.87,645,1363132800"; d="scan'208";a="13168615" Received: from unknown (HELO rathaus.eclipse.co.uk) ([91.85.55.216]) by smtpout.karoo.kcom.com with ESMTP; 10 May 2013 05:17:44 +0100 Date: Fri, 10 May 2013 05:45:37 +0100 From: "Steven J. Long" To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] Re: OpenRC supporting systemd units Message-ID: <20130510044537.GA2776@rathaus.eclipse.co.uk> Mail-Followup-To: gentoo-dev@lists.gentoo.org References: <20130508183201.GC8256@linux1> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Archives-Salt: 87e5e244-da7b-4e7c-85ac-ef3753e71a6d X-Archives-Hash: b17931eea97937260c28ceacc68bceac Ambroz Bizjak wrote: > Rich Freeman wrote: > > Init.d scripts are programs - they could probably do just about anything. > > They couldn't monitor a process and restart it when it crashes, as > specified by the restart options in the unit file. That is, without > significant modifications in the way OpenRC works, such as adding a > monitoring process, or hacks such as launching a daemon that monitor > that process specifically. Actually a shell script can do that very easily, given a daemon that either doesn't self-background, or can be given a switch to tell it not to "daemonize", which reasonably modern services should support. See Q: 3.2 here: http://mywiki.wooledge.org/ProcessManagement (the linked "Wrapper Script" page is interesting as well.) That's assuming you don't want a simple respawn in inittab. Another common loop is: until somesrv -f "$blah"; do e=$? # stuff on abnormal termination, check situation etc all_ok || exit # exits $?, or use $e or 1.. done # svc terminated normally : -- #friendly-coders -- We're friendly, but we're not /that/ friendly ;-)