Uploaded image for project: 'Support'
  1. Support
  2. SUPPORT-189

KSM log messages from enforcer gets lost

    XMLWordPrintable

    Details

    • Type: Support
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: OpenDNSSEC 1.4.7, OpenDNSSEC 2.0
    • Fix Version/s: None
    • Component/s: Enforcer
    • Labels:
      None
    • Environment:

      NetBSD/amd64 6.1.5, OpenDNSSEC 1.4.9

      Description

      While debugging the problem with the zone where the enforcer cannot allocate any keys, I stumble across the problem that the error messages from the enforcer of the "KSM" type appear to get discarded.

      In particular, it would have been interesting to see the error message logged from KsmKeyGetUnallocated() from this part:

      if (status != 0)

      { status = MsgLog(KSM_SQLFAIL, DbErrmsg(DbHandle())); DbFreeResult(result); return status; }

      The reason these log messages appear to be discarded, is that the error code range has not been set up to go anywhere, and absent such setup, MsgSetOutput() will pick MsgDefaultOutput, and that does just printf() on stdout, and since the enforcer is daemonized, that goes exactly nowhere:

      hugin# ps ax | grep enfor
      774 ? Ss 4:12.65 /usr/pkg/sbin/ods-enforcerd
      2802 pts/19 R+ 0:00.00 grep enfor
      hugin# fstat -p 774
      USER CMD PID FD MOUNT INUM MODE SZ|DV R/W
      ods ods-enforcerd 774 wd /var 6447361 drwxrwxrwx 78848 r
      ods ods-enforcerd 774 0 / 10351 crw-rw-rw- null rw
      ods ods-enforcerd 774 1 / 10351 crw-rw-rw- null rw
      ods ods-enforcerd 774 2 / 10351 crw-rw-rw- null rw
      ...

      Furtermore, it seems that in enforcer/ksm/include/ksm/, the status_messages.pl
      script has not been run over ksmdef.h, only over kmedef.h, so there's no array of messages to point MsgRegister at, and no automatically computed max value from ksmdef.h. Also, the status_messages.pl script needs to be updated to support the KSM message prefix, and common/daemon.c needs to call MsgRegister on those messages, directing the output to ksm_log_msg().

      The attached diff does this and includes the resulting generated ksmmsg.h file.

        Attachments

          Activity

            People

            Assignee:
            hodar Hoda Rohani
            Reporter:
            he Håvard Eidnes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: