From owner-freebsd-questions@freebsd.org Fri Nov 10 16:47:27 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 763FEE71B90 for ; Fri, 10 Nov 2017 16:47:27 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDF267A566 for ; Fri, 10 Nov 2017 16:47:26 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wm0-x241.google.com with SMTP id g141so3943771wmg.2 for ; Fri, 10 Nov 2017 08:47:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dOHEtJE8aKUilMy5UCkgYvqretZXvFqI+ui3XwqM4gU=; b=dAX34o0pDqG+BtS0uaqzgl7DWNhI1VexfENBhp6prWvUEudzuo07AR+q17FPggnhoS ptUQJH4zEHWki9kc85Q2XXSBCe4V+c671wwyDfvBMrRkutvnAT9vVpmYq3kazA6N4isa 0ztRKN4U6Aakg6ej/gIyptnwhOIDZwUDNYzy/JxpZzWGFkEs4IKjntfOTDiRD8iIWbsG vyYg5ED+r+HbcDpxCw83oIptaFibesOcQfgSOLHFdvcJeOyNjO4ikd+lHMtl6BDOuoOq 4ISkJFiQ2XTLxZ6xYWRR2qZNDTAM2JqOIOidMDTsm/MnXGSn3NQVJDwoDKzKgHeTI3Og x6NA== X-Gm-Message-State: AJaThX56H5FI/UnVhHz8xp2uidWPurhMfJIEhIw2Kegyni7sujOt4UbS Wri2FCPC4NCEJbnLO6+Q0i8LTg== X-Google-Smtp-Source: AGs4zMYtko/k/UnwsSs0hy5+pQ/ihFtUGwSkYnaA7RvXwmpnrK8Y7WN38Sbx2IvcPRHfSLgCpc1nNA== X-Received: by 10.80.150.196 with SMTP id z4mr1401114eda.110.1510332445173; Fri, 10 Nov 2017 08:47:25 -0800 (PST) Received: from gumby.homeunix.com ([81.17.24.158]) by smtp.gmail.com with ESMTPSA id o60sm7912083eda.48.2017.11.10.08.47.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Nov 2017 08:47:24 -0800 (PST) Date: Fri, 10 Nov 2017 16:47:20 +0000 From: RW To: freebsd-questions@freebsd.org Subject: Re: Need help with rc.d script Message-ID: <20171110164720.61b0e053@gumby.homeunix.com> In-Reply-To: <5A05CAA8.8040607@gmail.com> References: <20171108021900.W9710@sola.nimnet.asn.au> <5A0481AE.7050504@gmail.com> <20171110211228.O72828@sola.nimnet.asn.au> <5A05CAA8.8040607@gmail.com> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.31; amd64-portbld-freebsd11.1) 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: Fri, 10 Nov 2017 16:47:27 -0000 On Fri, 10 Nov 2017 10:50:00 -0500 Ernie Luzar wrote: > I believe we should continual working on getting method 2 working so > we all learn how rc.d really works and if need be submit a update to > the handbook rc.d documentation to give the reader a clearer picture > of what needs to be done to use the rc.d framework for a sh script. > > https://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/rcng-daemon.html > > This talks about setting the command_interpreter variable for > executable scripts. I tested using the testloop rc.d script posted > previously with command_interpreter="/bin/sh" and a second time with > command_interpreter="sh" and in both cases no pid file was created. The daemon is responsible for creating the pidfile. I don't recall the full details, but rcng needs to know the pid of a daemon to shut it down, but it's possible that the daemon has died and that pid has been reassigned to something else. So before it shuts the daemon down it checks the command field in the ps output. command_interpreter is a part of reconstructing that command field. I'm not sure, but I don't think it plays a part in starting the daemon.