tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: net/sysmon rc.d script
On 08/31, Brook Milligan wrote:
> > On Aug 30, 2026, at 06:35, Greg Troxel <gdt%lexort.com@localhost> wrote:
> > Brook Milligan <brook%biology.nmsu.edu@localhost> writes:
> >>> On Aug 29, 2026, at 18:27, Greg Troxel <gdt%lexort.com@localhost> wrote:
> >>> That looks ok, except that pause and resume seem novel and I'm not sure
> >>> about the wisdom of defining them first in pkgsrc. Do you have a
> >>> compelling need?
> >>
> >> I was just exposing the commands that are offered by the daemon. It
> >> seems reasonable that if someone reads the man page, they might expect
> >> those to work via the script. I have the sense that those are the
> >> canonical ways of controlling processes, no?
> >
> > That is not a reasonable or documented expectation, and it is not
> > consistent with our current practice. daemons can be far richer than
> > the rc system. The keywords to rc.d scripts are not textually related
> > to the keywords used to invoke daemons; the former defines an abstract
> > interface and the latter is just how any daemon is. The point is to map
> > the abstract interface to the daemon's behavior.
> >
> > Adding random extra rc.d commands is an interface change and should only
> > happen with discussion and a broad consensus that it's a good idea.
> >
> > You may be being misled about 'reload' which is listed as extra, but
> > notice that reload is very common in rc.d, to the point where it should
> > be hoisted to be formally part of the interface instead of evolved de
> > facto part.
>
> This seems to be an unfortunately restrictive view of the purpose of
> rc.d scripts. The rc(8) man page includes the following paragraph:
>
> rc.d/ is the directory which contains various sh(1) scripts, one
> for each service, which are called by rc at startup, rc.shutdown at
> shutdown, and as necessary during system operation to stop, start,
> restart, reload, or otherwise control the service.
>
> To me, the last phrase seems important and supportive of the idea that
> the intended purpose of rc.d scripts goes beyond the narrow API needed
> for rc/rc.shutdown themselves.
I think the sentence below the list of expected arguments is even more
supportive:
Other arguments (such as `reload', `dumpdb', etc) can be added if
necessary.
And just because I was looking at rc.d scripts in pkgsrc to see if they
used hard-coded paths and if so, which paths, I came across qmail.sh
https://github.com/NetBSD/pkgsrc/blob/trunk/mail/qmail-run/files/qmail.sh
from mail/qmail-run, which has thirteen keywords: stop, start, pause,
cont, stat, cdb, restart, doqueue, reload, queue, alrm, flush, and hup.
So, there's at least one rc.d script in pkgsrc that has added keywords
beyond the ones listed as required in the rc(8) man page.
I think it would be good to try to use the same keywords for the same
functionality across rc.d scripts, though. Maybe these would be
considered optional keywords or something. But that would perhaps
end up being more work for someone to survey them, propose a standard
keyword for the functionality in question, discuss, document it, and
rename the old keyword to match (along with providing an alias for the
old keyword for backward compatibility). Or it could be a more organic
process as people have time and are willing to update existing rc.d
scripts to whatever new standard optional keyword naming.
Lewis
Home |
Main Index |
Thread Index |
Old Index