Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Nov 2017 16:47:20 +0000
From:      RW <rwmaillists@googlemail.com>
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:  <mailman.444.1510052978.1530.freebsd-questions@freebsd.org> <20171108021900.W9710@sola.nimnet.asn.au> <CALfReyfuTFH25fAcG=CEL=p0XNyfQVVNi0EGxFwS-Ddv3QWY3A@mail.gmail.com> <5A0481AE.7050504@gmail.com> <20171110211228.O72828@sola.nimnet.asn.au> <5A05CAA8.8040607@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20171110164720.61b0e053>