tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: net/sysmon rc.d script
> On Aug 29, 2026, at 18:27, Greg Troxel <gdt%lexort.com@localhost> wrote:
>
> Brook Milligan <brook%biology.nmsu.edu@localhost> writes:
>
>> The net/sysmon package does not have an rc.d script but would seem to
>> benefit from one. I have drafted one up (see below) and would
>> appreciate comments, as I am not super familiar with the nuances of
>> rc.subr. For example, will the value of ${sysmon_flags} automatically
>> be inserted into the commands as written?
>
> A quick read of /etc/rc.subr says yes, but put something in it and check.
Just did. If the command is overridden, then no. It looks like all the overrides manually insert ${rc_flags} and whatnot.
>> In addition, one bikeshedding question: the package is called sysmon,
>> but the runnable program is sysmond. Which name should be used for
>> the rc.d script?
>
> A quick ls of /etc/rc.d suggests that it's messy, but the predominant
> practice is for the rc file to have the same name as the daemon.
Yes, it’s messy, which is why I was asking. There are many different patterns to choose from.
> 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?
I have attached an improved version, but please let me know if pause/resume should be left out or you see any other issues.
Thanks a lot for the help.
Cheers,
Brook
#!/bin/sh
#
# $NetBSD$
#
# PROVIDE: sysmond
# REQUIRE: NETWORKING
$_rc_subr_loaded . /etc/rc.subr
name="sysmond"
rcvar=$name
command=/usr/pkg/bin/${name}
pause_cmd="${command} pause"
reload_cmd="${command} reload"
resume_cmd="${command} resume"
extra_commands="pause reload resume"
load_rc_config $name
run_rc_command "$1"
Home |
Main Index |
Thread Index |
Old Index