• Ports that can start sub-instances -- how best to do rc.d scripts?

    From Dan Mahoney \(Ports\)@freebsd@gushi.org to muc.lists.freebsd.ports on Thu Sep 17 11:12:17 2026
    From Newsgroup: muc.lists.freebsd.ports

    Hey there folks,
    We at the dayjob are having trouble with a port we use (knockd) that only listens on a single interface and we're trying to get it to listen on multiple.
    Related: Some ports, such as Apache24 can take multiple arguments such that you can start/stop/restart only one instance.
    This is not a part of the normal rc.subr flow, and I fear different ports that do this may do it differently. Additionally, with tools like puppet, it's less idempotent and causes errors.
    So my questions:
    Are there other ports people know of that do this?
    Is there a "recognized, standard" way of doing this that any future port should use? I.e. if we were to submit the knockd rc.d script up to a maintainer with the changes, that it should follow?
    -Dan--
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Alexander Leidinger@Alexander@Leidinger.net to muc.lists.freebsd.ports on Fri Sep 18 09:46:28 2026
    From Newsgroup: muc.lists.freebsd.ports

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156)

    --=_8225e912c9623d5181a205b13b7cbbff
    Content-Transfer-Encoding: 7bit
    Content-Type: text/plain; charset=US-ASCII;
    format=flowed

    Am 2026-09-17 20:12, schrieb Dan Mahoney (Ports):
    Hey there folks,

    We at the dayjob are having trouble with a port we use (knockd) that
    only listens on a single interface and we're trying to get it to listen
    on multiple.

    Related: Some ports, such as Apache24 can take multiple arguments such
    that you can start/stop/restart only one instance.

    This is not a part of the normal rc.subr flow, and I fear different
    ports that do this may do it differently. Additionally, with tools
    like puppet, it's less idempotent and causes errors.

    So my questions:

    Are there other ports people know of that do this?

    Is there a "recognized, standard" way of doing this that any future
    port should use? I.e. if we were to submit the knockd rc.d script up
    to a maintainer with the changes, that it should follow?

    I'm not sure about "recognized" or "standard", but check out
    /usr/ports/www/tomcat110/files/tomcat110.in
    /usr/ports/devel/sonarqube-community/files/sonarqube.in
    /usr/ports/www/oauth2-proxy/files/oauth2_proxy.in

    The last two I modelled after the tomcat one.

    You simply create a symlink to the rc.d script and use the name of that symlink instead of the original name in rc.conf, e.g.
    rc.d:
    - original_service
    - instance_service -> original_service
    rc.conf:
    - sysrc instance_service_enable=YES
    - sysrc instance_service_config=/path/to/config # or
    whatever is needed

    Bye,
    Alexander.
    --
    http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF

    --=_8225e912c9623d5181a205b13b7cbbff
    Content-Type: application/pgp-signature;
    name=signature.asc
    Content-Disposition: attachment;
    filename=signature.asc;
    size=870
    Content-Description: OpenPGP digital signature

    -----BEGIN PGP SIGNATURE-----

    iQJPBAEBCAA5FiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmqs7F8bFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwzAAoJEBINsJsD+NiG3X0P/RCFVlBqNEPCh/YzsbJE RCXlPmjBc+bVoMFPHWI5xDhOM3lHTayGzCykNAlfxC/SvW68KzY1bPgaPhLX4VDK NdAcrDyYvLILsGniqIqtjb5fFb6syr71T4b+ZlqqN1tjMgyF6Nw6UrrS1HN2QDZ3 ECuX14qymlPcYxUhFXTeMFi1PxHWDu78Q5LAMq71vBMuZYHqeUkGdu2rvOjtvCbk SMQXxRcYoE7ydoijT/EDK5UPnJ8ymytDbNgYuZWZHJPTCgafRAkMNfrxLZ+dmFpx oieet1HRPBBwTe49xAWcH0o4x/UxoRfUqxPtBKYggNV7CERYdn5+AcdBs7n8XsfQ V8m77kYoO5d47LLcP0EHvGAdY9ZBhn9qfAtSwEQv6pB9aTYpKoPuVvK7YpieX7XN w1G9ZX65AhRu2kmSTBAr7axTL8dFyAdNy/vwq1Ns5/fIMPuuXKqp25Kl4z6KTp1q WQLk1D3uLu0LacBn4BFjZ0cxewW1wYDgQFuRuxHTwDAtHbDJWZEc20uFBsj/kQIY 2IFE3vMiD5bTY5dTaJ5jkEH7NW/3XU8fV54U9fUQJdlgW1zlX97FZDDsqP7cXmRH pxDQ4fjuOchWTMAeCLLoGFc191n30VLCtaDg/ARJVFURca+IaTIB2XYZ53LjtcPV 8It53cqBDap7xXjdZ33cpKx7
    =Cglv
    -----END PGP SIGNATURE-----

    --=_8225e912c9623d5181a205b13b7cbbff--


    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.22a-Linux NewsLink 1.2