Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smf manifest for sysutils/apcupsd #398

Open
stratacast opened this issue Dec 17, 2024 · 2 comments
Open

smf manifest for sysutils/apcupsd #398

stratacast opened this issue Dec 17, 2024 · 2 comments
Assignees

Comments

@stratacast
Copy link

I noticed there's no smf manifest for apcupsd. This is a naive attempt at generating one. This is what I created for the gz, installed apcupsd from the tools pkgsrc path.

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="application-apcupsd" >
    <service name="application/apcupsd" type="service" version="1" >
        <create_default_instance enabled="true" />
        <dependency name="dep0" grouping="require_all" restart_on="error" type="service" >
            <service_fmri value="svc:/milestone/multi-user:default" />
        </dependency>
        <exec_method type="method" name="start" exec="/opt/tools/sbin/apcupsd -f /opt/tools/etc/apcupsd/apcupsd.conf &amp;" timeout_seconds="10" >
            <method_context working_directory="/opt/tools/etc/apcupsd" >
                <method_credential user="root" group="staff" />
            </method_context>
        </exec_method>
        <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60" />
        <template >
            <common_name >
                <loctext xml:lang="C" >apcupsd</loctext>
            </common_name>
        </template>
    </service>
</service_bundle>
@jperkin
Copy link
Collaborator

jperkin commented Dec 19, 2024

Thanks! This will need a bit of work before it can be integrated. pkgsrc supports many different install types, so a lot of this information is extracted to variables so that it works for all builds.

Picking one at random:

https://github.com/NetBSD/pkgsrc/blob/trunk/sysutils/rsyslog/files/smf/manifest.xml

you can see various @VARIABLE@ strings, which are replaced for the target. I'd suggest using all of the ones included in that file, and also switching the group to root.

I'm happy to do this after the Christmas holidays if necessary.

@jperkin jperkin self-assigned this Dec 19, 2024
@stratacast
Copy link
Author

Probably still some stuff missing, but I tweaked it more to match what you shared

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="apcupsd" >
    <service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1" >
        <create_default_instance enabled="true" />
        <dependency name="multi-user" grouping="require_all" restart_on="error" type="service" >
            <service_fmri value="svc:/milestone/multi-user:default" />
        </dependency>
        <dependency name="network" grouping="require_all" restart_on="error" type="service">
          <service_fmri value="svc:/milestone/network:default" />
        </dependency>
        <exec_method type="method" name="start" exec="@PREFIX@/sbin/apcupsd -f /opt/tools/etc/apcupsd/apcupsd.conf &amp;" timeout_seconds="10" >
            <method_context working_directory="@PREFIX@/etc/apcupsd" >
                <method_credential user="root" group="root" />
            </method_context>
        </exec_method>
        <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60" />
        <template >
            <common_name >
                <loctext xml:lang="C" >apcupsd</loctext>
            </common_name>
        </template>
    </service>
</service_bundle>

I'm not sure if that multi-user dependency is necessary. Maybe that dependency was generated because group was staff? I would assume too, looking at the rsyslog example, it could use network the network dependency perhaps. Since some configurations of apcupsd could require networking. I'm connected over USB.

Thank you! Enjoy your Christmas and New Year

jperkin pushed a commit that referenced this issue Jan 28, 2025
Pkgsrc changes:
 * Remove now-upstream-integrated patch.
 * Checksum changes.

Upstream changes:

NSD version 4.11.0 had a serious bug in which applying updates to
zones (and other modifications that require a reload, such as adding
and deleting zones), could stop entirely after reception of a broken
or corrupted update via zone transfer. We believe that this broken
state would appear as one of the NSD processes consuming 100% CPU.
Version 4.11.1 has this corrected as well as some other smaller
non-critical bugs.

We strongly advise to not run NSD version 4.11.0, and if you have
it deployed already, upgrade to 4.11.1 at the earliest possible
opportunity.

4.11.1
================
BUG FIXES:
        - Fix #415: Fix out of tree builds. Thanks Florian Obser (@fobser).
        - Fix #414: XoT interoperability with BIND and Knot
        - Fix #421: old-main can quit before the reload process received
          from old-main that it is done on the reload_listener pipe.
          Thanks Otto Retter.
        - Fix whitespace in comment.
        - Fix #424: Stalled updates after corrupt transfer.

4.11.0
================
FEATURES:
        - Support reloading configuration on SIGHUP.
        - Fix #383: log timestamps in ISO8601 format with timezone.
          This adds the option `log-time-iso: yes` that logs in ISO8601
          format.
        - Updated cookie secrets management.
          The default cookie secret file location can be set at compile time
          with the --with-cookiesecretsfile=path option to configure. The
          default location is changed to {dbdir}/cookiesecrets.txt. The
          previous default location will be checked at startup when there is
          no cookie secrets file at the new default location.
          A staging cookie can now also be configured in the configuration
          file and secrets configured in the configuration file now take
          precedence over those read from file.
          All DNS related setting in the configuration file will be reevaluated
          and effectuated after nsd-control reconfig.
        - Merge #398: RFC 9660 The DNS Zone Version (ZONEVERSION) Option
        - Merge #406: ohttp and tls-supported-groups SvcParam suppor
        - Merge #408: NINFO, RKEY, RESINFO, WALLET, CLA and TA RR types
        - Merge #409: Writing of NSAP-PTR, GPOS and HIP RR types
        - Merge #407: Better balanced verbosity levels for logging.

BUG FIXES:
        - Fix title underline and declaration after statement warnings.
        - Add cross platform freebsd, openbsd and netbsd to github ci.
        - Update simdzone to include fix for netbsd double bswap declarations,
          and also semantic checks for DS and ZONEMD. And CFLAGS has -march
          prepended to fix detection.
        - Merge #376: Point the user towards tcpdump for logging individual
          queries.
        - Track $INCLUDEs in zone files.
        - Fix ci to update macos-12 to the macos-15 runner image.
        - Merge #390: Apply non-xfr tasks before xfr tasks.
          This fixes an issue where non-xfr tasks are lost when they are
          batch processed together with non-xfr tasks.
          This merge also changes that notifies are passed on from the serve
          processes to the xfrd directly instead of via main. This was
          necessary to allow applying the non-xfr tasks without forking a
          backup-main for the sole purpose of forwarding notifies.
        - Merge #391: Update copyright lines (in version output).
        - Fix #392: Inconsistent documentation about control-interface.
        - Merge #395: Explain the zonefile example better.
        - Merge #394: Fix the path to use doc/manual/.
        - Fix analyzer issue in do_print_cookie_secrets to check for failure.
        - Merge #404: Introducing Sphinx substitution in code blocks.
          As well as other fixes with Sphinx build.
        - Update Copyright lines in help output
        - Merge #395: Explain zonefile example better
        - Merge #394: Fix doc path (fixes "Edit on GitHub" button in the docs)
        - Fix Makefile for parallel build failure around bison rule.
        - Fix #405: Fix typo in documentation.
        - Treat a mismatch in RRset TTLs as a warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants