Bug 245362 - net/isc-dhcp44-server could not be started chrooted after CURRENT r359068
Summary: net/isc-dhcp44-server could not be started chrooted after CURRENT r359068
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ryan Steinmetz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-04 22:59 UTC by Lev A. Serebryakov
Modified: 2021-06-02 16:04 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (zi)


Attachments
isc-dhcp44-server.conditional-copy.diff (817 bytes, patch)
2021-05-26 20:44 UTC, Igor Ostapenko
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lev A. Serebryakov freebsd_committer 2020-04-04 22:59:26 UTC
It fails with error:

/usr/local/etc/rc.d/isc-dhcpd: ERROR: unable to copy /etc/host.conf to /var/db/dhcpd/etc/host.conf -- not a file or a directory

After r359068 there is no /etc/host.conf anymore.
Comment 1 Lev A. Serebryakov freebsd_committer 2020-04-04 23:02:30 UTC
And, I think, nsswitch.conf should be copied instead.
Comment 2 Igor Ostapenko 2021-05-26 20:43:37 UTC
For now I use conditional copying, if the file exists. I'm not sure whether it's the best way, but works for me with 12 and 13.
Comment 3 Igor Ostapenko 2021-05-26 20:44:57 UTC
Created attachment 225294 [details]
isc-dhcp44-server.conditional-copy.diff
Comment 4 Niels Bakker 2021-05-28 10:51:33 UTC
/etc/rc.d/nsswitch was responsible for creating host.conf for legacy binaries, but that file was removed somewhere between 12.2 and 13.0. New installations won't have either file and rc.d/isc-dhcpd must not depend on its presence.
Comment 5 Niels Bakker 2021-05-30 12:57:47 UTC
(In reply to Lev A. Serebryakov from comment #1)

> And, I think, nsswitch.conf should be copied instead.

I agree, that seems to be the correct file starting with FreeBSD 5.0. And since this affects every new 13.0 installation, can the importance of this bugreport be upgraded from "Affects only me" to something more severe?
Comment 6 Ryan Steinmetz freebsd_committer freebsd_triage 2021-06-02 16:02:35 UTC
Thanks!
Comment 7 commit-hook freebsd_committer 2021-06-02 16:04:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=48ac5fb485dc9271286eb93789a6bf70ba6f5f4a

commit 48ac5fb485dc9271286eb93789a6bf70ba6f5f4a
Author:     Ryan Steinmetz <zi@FreeBSD.org>
AuthorDate: 2021-06-02 16:01:50 +0000
Commit:     Ryan Steinmetz <zi@FreeBSD.org>
CommitDate: 2021-06-02 16:03:20 +0000

    net/isc-dhcp44-server: Fix chroot support on 13.x

    - Bump PORTREVISION

    PR:             245362

 net/isc-dhcp44-server/Makefile           | 2 +-
 net/isc-dhcp44-server/files/isc-dhcpd.in | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)