From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 19 15:37:01 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D1CB16A41F for ; Wed, 19 Oct 2005 15:37:01 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09F8443D6E for ; Wed, 19 Oct 2005 15:36:56 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j9JFataF090060; Wed, 19 Oct 2005 10:36:55 -0500 (CDT) (envelope-from dan) Date: Wed, 19 Oct 2005 10:36:55 -0500 From: Dan Nelson To: Marco Molteni Message-ID: <20051019153655.GB4225@dan.emsphone.com> References: <200510191715.21582.molter@tin.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200510191715.21582.molter@tin.it> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 Cc: hackers@freebsd.org Subject: Re: rc scripts: how to start a process that doesn't daemonize itself? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2005 15:37:01 -0000 In the last episode (Oct 19), Marco Molteni said: > I have a program that I would like to control via a rc script, > say /usr/local/etc/rc.d/myprog > > problem is this program needs to be put explicitly in background. > > I was playing with things like > > command="/usr/sbin/daemon /usr/local/bin/myprog" > > but this obviously works only for the start case. > > Should I just override start() completely or is there a > common way to do it? I don't think I can simply pass a "&" somewhere... Try putting the "&" in command_args; that way it'll only be used during startup. I do that in some of my homegrown rc.d scripts. A (probably cleaner) way is to set start_cmd="/usr/sbin/daemon /usr/local/bin/myprog" -- Dan Nelson dnelson@allantgroup.com