tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: net/sysmon rc.d script
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.
> 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.
> #!/bin/sh
> #
> # $NetBSD$
> #
>
> # PROVIDE: sysmon
> # REQUIRE: NETWORKING
>
> $_rc_subr_loaded . /etc/rc.subr
>
> name="sysmond"
> rcvar=$name
> command=/usr/pkg/bin/${name}
> start_cmd="${command}"
> stop_cmd="${command} stop"
> 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"
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?
Home |
Main Index |
Thread Index |
Old Index