• Bug#1066081: ntpsec: ntpd reports error about missing /var/log/ntpsec

    From Felix Moessbauer@21:1/5 to All on Tue Mar 12 09:40:01 2024
    This is a multi-part MIME message sent by reportbug.


    Package: ntpsec
    Version: 1.2.3+dfsg1-1
    Severity: normal

    Dear Maintainer,

    the ntpd reports the following error when starting:
    statistics directory /var/log/ntpsec/ does not exist or is unwriteable, error No such file or directory

    While the service seems to be able to start, this directory is never
    created and logs / statistics are not written.

    Attached is a patch that creates this directory. Note, that we need to
    use tmpfiles.d as this directory is on /var.

    Best regards,
    Felix Moessbauer
    Siemens AG

    -- System Information:
    Debian Release: 12.5
    APT prefers stable-updates
    APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
    Architecture: amd64 (x86_64)

    Kernel: Linux 6.5.0-0.deb12.4-amd64 (SMP w/8 CPU threads; PREEMPT)
    Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
    Shell: /bin/sh linked to /usr/bin/dash
    Init: systemd (via /run/systemd/system)
    LSM: AppArmor: enabled

    Versions of packages ntpsec depends on:
    ii adduser 3.134
    ii init-system-helpers 1.65.2
    ii libbsd0 0.11.7-2
    ii libc6 2.36-9+deb12u4
    ii libcap2 1:2.66-4
    ii libssl3 3.0.11-1~deb12u2
    ii netbase 6.4
    ii python3 3.11.2-1+b1
    pn python3-ntp <none>
    ii sysvinit-utils [lsb-base] 3.06-4
    ii tzdata 2024a-0+deb12u1

    Versions of packages ntpsec recommends:
    ii cron [cron-daemon] 3.0pl1-162
    ii systemd 252.22-1~deb12u1

    Versions of packages ntpsec suggests:
    ii apparmor 3.0.8-3
    pn certbot <none>
    pn ntpsec-doc <none>
    pn ntpsec-ntpviz <none>

    From f1b9ac43a726f2e99addb616964ec9ef6e3c3341 Mon Sep 17 00:00:00 2001
    From: Felix Moessbauer <felix.moessbauer@siemens.com>
    Date: Tue, 12 Mar 2024 09:07:51 +0100
    Subject: [PATCH 1/1] fix(debian): create ntpsec logdir on var

    ntpd writes logs and statistics to this directory, but does not create
    it. As this dir is on /var, we use tmpdirs.d to create it if not
    existing.

    Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
    ---
    debian/ntpsec.tmpfiles | 1 +
    1 file changed, 1 insertion(+)
    create mode 100644 debian/ntpsec.tmpfiles

    diff --git a/debian/ntpsec.tmpfiles b/debian/ntpsec.tmpfiles
    new file mode 100644
    index 000000000..9a8fab6e0
    --- /dev/null
    +++ b/debian/ntpsec.tmpfiles
    @@ -0,0 +1 @@
    +d /var/log/ntpsec 0700 ntpsec ntpsec -
    --
    2.39.2

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Laager@21:1/5 to All on Tue Mar 12 17:50:02 2024
    (Replying via mobile, so non-Debian address.)

    It should be reasonably possible to convert this to .d style. I will have to dig into this to fully consider all the implications, especially around handling upgrades. I think part of the issue here is that ntpd logs there by default. That is, you don’
    t turn on logging. I’m not sure if there is a way to turn off logging. But I have to check.

    I want to maintain the same posture we have now:

    - No logs by default. Most people don’t use them, so this is pointless I/O.
    - People can enable logs reasonably easily.
    - Installing ntpviz automatically enables logs.

    For upgrades, I can use the presence or absence of the directory for most of the handling. I do need to think through what happens / what to do if someone has customized any of the other log settings.

    --
    Richard

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)