• Bug#1101003: dhcpcd-base: dhcpcd-run-hooks .d dir support would be usef

    From =?UTF-8?Q?Martin=2D=C3=89ric_Racine@21:1/5 to dxld@darkboxed.org on Wed Mar 26 11:10:01 2025
    On Fri, 21 Mar 2025 21:30:50 +0100 Daniel =?utf-8?Q?Gr=C3=B6ber?= <dxld@darkboxed.org> wrote:
    On Fri, Mar 21, 2025 at 09:57:01PM +0200, Martin-Éric Racine wrote:
    This is yet another upstream issue. Debian is the wrong place to report this.

    Since we've switched to dhcpcd by default this very much is a Debian
    issue. dhclient had this feature, people will be expecting it in it's replacement.

    Just because this is a patch we should also clear with upstream before applying I don't see why we shouldn't have a tracking issue for it in
    Debian. Very much the opposite tracking issues are highly useful.

    If you don't want to work on it that's fine. dhcpcd is collab maintained
    last I checked being in the debian/ namespace on salsa. Right? I'm planning to work on a number of these issues to get it into shape for trixie and BTS is my TODO list here.

    For what it's worth, here's how little the feature is used even for dhclient.

    In Bookworm:
    $ apt-file search dhclient-exit-hooks.d
    avahi-autoipd: /etc/dhcp/dhclient-exit-hooks.d/zzz_avahi-autoipd
    chrony: /etc/dhcp/dhclient-exit-hooks.d/chrony
    cloud-init: /etc/dhcp/dhclient-exit-hooks.d/hook-dhclient
    ddclient: /etc/dhcp/dhclient-exit-hooks.d/ddclient
    debian-edu-config: /etc/dhcp/dhclient-exit-hooks.d/autofs-reload debian-edu-config: /etc/dhcp/dhclient-exit-hooks.d/fetch-rootca-cert debian-edu-config: /etc/dhcp/dhclient-exit-hooks.d/hostname
    debian-edu-config: /etc/dhcp/dhclient-exit-hooks.d/wpad-proxy-update isc-dhcp-client: /etc/dhcp/dhclient-exit-hooks.d/debug
    isc-dhcp-client: /etc/dhcp/dhclient-exit-hooks.d/rfc3442-classless-routes ntpsec: /etc/dhcp/dhclient-exit-hooks.d/ntpsec
    ntpsec-ntpdate: /etc/dhcp/dhclient-exit-hooks.d/ntpsec-ntpdate
    sendmail-base: /etc/dhcp/dhclient-exit-hooks.d/sendmail
    sendmail-base: /usr/share/sendmail/examples/dhcp/dhclient-exit-hooks.d/sendmail sendmail-base: /usr/share/sendmail/examples/dhcp/dhclient-exit-hooks.d/sendmail.md5sum
    systemd-timesyncd: /etc/dhcp/dhclient-exit-hooks.d/timesyncd
    whereami: /etc/dhcp/dhclient-exit-hooks.d/whereami
    whereami: /etc/dhcp3/dhclient-exit-hooks.d/whereami
    $ apt-file search dhclient-enter-hooks.d
    avahi-autoipd: /etc/dhcp/dhclient-enter-hooks.d/avahi-autoipd
    isc-dhcp-client: /etc/dhcp/dhclient-enter-hooks.d/debug
    openresolv: /etc/dhcp/dhclient-enter-hooks.d/resolvconf
    resolvconf: /etc/dhcp/dhclient-enter-hooks.d/resolvconf
    samba-common: /etc/dhcp/dhclient-enter-hooks.d/samba

    In Trixie:
    $ apt-file search dhclient-exit-hooks.d
    avahi-autoipd: /etc/dhcp/dhclient-exit-hooks.d/zzz_avahi-autoipd
    chrony: /etc/dhcp/dhclient-exit-hooks.d/chrony
    ddclient: /etc/dhcp/dhclient-exit-hooks.d/ddclient
    debian-edu-config: /etc/dhcp/dhclient-exit-hooks.d/autofs-reload debian-edu-config: /etc/dhcp/dhclient-exit-hooks.d/fetch-rootca-cert debian-edu-config: /etc/dhcp/dhclient-exit-hooks.d/hostname
    debian-edu-config: /etc/dhcp/dhclient-exit-hooks.d/wpad-proxy-update isc-dhcp-client: /etc/dhcp/dhclient-exit-hooks.d/debug
    isc-dhcp-client: /etc/dhcp/dhclient-exit-hooks.d/resolved
    isc-dhcp-client: /etc/dhcp/dhclient-exit-hooks.d/rfc3442-classless-routes ntpsec: /etc/dhcp/dhclient-exit-hooks.d/ntpsec
    ntpsec-ntpdate: /etc/dhcp/dhclient-exit-hooks.d/ntpsec-ntpdate
    sendmail-base: /etc/dhcp/dhclient-exit-hooks.d/sendmail
    sendmail-base: /usr/share/sendmail/examples/dhcp/dhclient-exit-hooks.d/sendmail sendmail-base: /usr/share/sendmail/examples/dhcp/dhclient-exit-hooks.d/sendmail.md5sum
    systemd-timesyncd: /etc/dhcp/dhclient-exit-hooks.d/timesyncd
    whereami: /etc/dhcp/dhclient-exit-hooks.d/whereami
    $ apt-file search dhclient-enter-hooks.d
    avahi-autoipd: /etc/dhcp/dhclient-enter-hooks.d/avahi-autoipd
    isc-dhcp-client: /etc/dhcp/dhclient-enter-hooks.d/debug
    isc-dhcp-client: /etc/dhcp/dhclient-enter-hooks.d/resolved-enter
    openresolv: /etc/dhcp/dhclient-enter-hooks.d/resolvconf
    resolvconf: /etc/dhcp/dhclient-enter-hooks.d/resolvconf

    Basically, while the idea of offering a directory for administrator
    scripts is a noble one, the need is very small. Let's call it a
    wishlist item.

    Martin-Éric

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Hofstaedtler@21:1/5 to All on Wed Mar 26 12:50:01 2025
    * Martin-Éric Racine <martin-eric.racine@iki.fi> [250326 11:09]:
    On Fri, 21 Mar 2025 21:30:50 +0100 Daniel =?utf-8?Q?Gr=C3=B6ber?= ><dxld@darkboxed.org> wrote:
    On Fri, Mar 21, 2025 at 09:57:01PM +0200, Martin-Éric Racine wrote:
    This is yet another upstream issue. Debian is the wrong place to report this.

    Since we've switched to dhcpcd by default this very much is a Debian
    issue. dhclient had this feature, people will be expecting it in it's
    replacement.

    Just because this is a patch we should also clear with upstream before
    applying I don't see why we shouldn't have a tracking issue for it in
    Debian. Very much the opposite tracking issues are highly useful.

    If you don't want to work on it that's fine. dhcpcd is collab maintained
    last I checked being in the debian/ namespace on salsa. Right? I'm planning >> to work on a number of these issues to get it into shape for trixie and BTS >> is my TODO list here.

    For what it's worth, here's how little the feature is used even for dhclient.

    In Bookworm:
    $ apt-file search dhclient-exit-hooks.d
    avahi-autoipd: /etc/dhcp/dhclient-exit-hooks.d/zzz_avahi-autoipd
    chrony: /etc/dhcp/dhclient-exit-hooks.d/chrony
    [..]

    In Trixie:
    $ apt-file search dhclient-exit-hooks.d
    avahi-autoipd: /etc/dhcp/dhclient-exit-hooks.d/zzz_avahi-autoipd
    chrony: /etc/dhcp/dhclient-exit-hooks.d/chrony
    [..]

    Basically, while the idea of offering a directory for administrator
    scripts is a noble one, the need is very small. Let's call it a
    wishlist item.

    If anyone in the future considers implementing this, please also
    consider:

    1) packaged software can decide to listen on netlink events instead

    2) packaged software probably wants to avoid dropping new scripts as
    conffiles into /etc; so it would make sense to provide an
    extension point in /usr that the admin can override in /etc

    3) for local administrators dropping something in /etc might still
    make sense


    Personally I have no opinion if this feature should ever be done.

    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Martin=2D=C3=89ric_Racine@21:1/5 to zeha@debian.org on Sat Apr 19 11:30:02 2025
    On Wed, 26 Mar 2025 12:40:45 +0100 Chris Hofstaedtler <zeha@debian.org> wrote:
    * Martin-Éric Racine <martin-eric.racine@iki.fi> [250326 11:09]:
    On Fri, 21 Mar 2025 21:30:50 +0100 Daniel =?utf-8?Q?Gr=C3=B6ber?= ><dxld@darkboxed.org> wrote:
    On Fri, Mar 21, 2025 at 09:57:01PM +0200, Martin-Éric Racine wrote:
    This is yet another upstream issue. Debian is the wrong place to report this.

    Since we've switched to dhcpcd by default this very much is a Debian
    issue. dhclient had this feature, people will be expecting it in it's
    replacement.

    Just because this is a patch we should also clear with upstream before
    applying I don't see why we shouldn't have a tracking issue for it in
    Debian. Very much the opposite tracking issues are highly useful.

    If you don't want to work on it that's fine. dhcpcd is collab maintained >> last I checked being in the debian/ namespace on salsa. Right? I'm planning
    to work on a number of these issues to get it into shape for trixie and BTS
    is my TODO list here.

    For what it's worth, here's how little the feature is used even for dhclient.

    In Bookworm:
    $ apt-file search dhclient-exit-hooks.d
    avahi-autoipd: /etc/dhcp/dhclient-exit-hooks.d/zzz_avahi-autoipd
    chrony: /etc/dhcp/dhclient-exit-hooks.d/chrony
    [..]

    In Trixie:
    $ apt-file search dhclient-exit-hooks.d
    avahi-autoipd: /etc/dhcp/dhclient-exit-hooks.d/zzz_avahi-autoipd
    chrony: /etc/dhcp/dhclient-exit-hooks.d/chrony
    [..]

    Basically, while the idea of offering a directory for administrator
    scripts is a noble one, the need is very small. Let's call it a
    wishlist item.

    If anyone in the future considers implementing this, please also
    consider:

    1) packaged software can decide to listen on netlink events instead

    2) packaged software probably wants to avoid dropping new scripts as
    conffiles into /etc; so it would make sense to provide an
    extension point in /usr that the admin can override in /etc

    3) for local administrators dropping something in /etc might still
    make sense


    Personally I have no opinion if this feature should ever be done.

    Chris

    Looking into the source code for dhcpcd-run-hooks:

    for hook in \
    @SYSCONFDIR@/dhcpcd.enter-hook \
    @HOOKDIR@/* \
    @SYSCONFDIR@/dhcpcd.exit-hook
    do

    Which using our current configure options translates to:

    for hook in \
    /etc/dhcpcd.enter-hook \
    /usr/lib/dhcpcd/dhcpcd-hooks/* \
    /etc/dhcpcd.exit-hook
    do

    Basically, we already support user scripts. However, the above
    fragment suggests that these are currently admin-configured flat
    files, rather than directories whose content is sourced. If
    directories would be preferable, this should be discussed upstream at https://github.com/NetworkConfiguration/dhcpcd/issues/494 instead of
    here.

    Martin-Éric

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