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/29, Brook Milligan wrote:
> 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.
>
> #!/bin/sh
> #
> # $NetBSD$
> #
>
> # PROVIDE: sysmon
> # REQUIRE: NETWORKING
>
> $_rc_subr_loaded . /etc/rc.subr
Hi, Brook!
The one concern/question I have is with the hard-coded paths. This is a
concern/question for all rc.d scripts in pkgsrc, not just yours, though.
The first hard-coded path is /etc used above for the location of
rc.subr. When you bootstrap pkgsrc, you can set the location of the
system configuration directory (i.e., "--sysconfdir <sysconfdir>"),
so /etc may not be the bootstrapped system configuration directory.
Obviously, if the bootstrapped system configuration directory is not
/etc, the above line could fail because rc.subr doesn't exist or because
it would load an rc.subr that is not from the bootstrapped system
configuration directory, which might or might not work, but regardless
is incorrect.
I think this would be installed to share/examples/rc.d/sysmon. And the
question is whether pkgsrc has a standard for what paths should be used
in example rc.d scripts. I don't think it does, but maybe I missed it
somewhere? In that case, what you've done here is probably correct, but
I've always wondered about this, so I'm bringing it up in case someone
knows more about this and could comment.
pkgsrc does have a way to install rc.d scripts with the RCD_SCRIPTS
variable as described at
https://www.netbsd.org/docs/pkgsrc/pkginstall.html#rcd-scripts
That says that this is handled by pkginstall and that it applies "the
substitutions described in the FILES_SUBST variable." So, perhaps this
means that the idea is to use standard paths (or NetBSD paths?) in
the rc.d script, and then if using the RCD_SCRIPTS mechanism, you
also define the FILES_SUBST variable to replace the paths with paths
appropriate for the pkgsrc tree (e.g., bootstrapped system configuration
directory, prefix, etc.).
Sorry, and now I'm getting closer to hijacking your thread, but does
anyone know whether the RCD_SCRIPTS mechanism ensures that the rc.subr
file gets installed to the bootstrapped system configuration directory?
I have a vague recollection that it was not installed for some situation
I had many years ago, but I can't remember now. Obviously, if nothing
installs it, then it might not exist, and yet most installed rc.d
scripts need it, including this proposed one for sysmon.
> name="sysmond"
> rcvar=$name
> command=/usr/pkg/bin/${name}
Here's the other hard-coded path: /usr/pkg. When bootstrapping pkgsrc,
you can set the prefix with the "--prefix <prefix>" option.
Regards,
Lewis
Home |
Main Index |
Thread Index |
Old Index