FreeBSD Bugzilla – Attachment 246435 Details for
Bug 275205
dns/coredns: change working directory to load extra config files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
change working directory in precmd
0001-dns-coredns-fix-hosts-file-can-not-be-load-from-Core.patch (text/plain), 2.32 KB, created by
King John
on 2023-11-20 03:25:53 UTC
(
hide
)
Description:
change working directory in precmd
Filename:
MIME Type:
Creator:
King John
Created:
2023-11-20 03:25:53 UTC
Size:
2.32 KB
patch
obsolete
>From a584ea90f2ca599e204d56c7dd81e9fd5e5d97a4 Mon Sep 17 00:00:00 2001 >From: King John <jinking.this@gmail.com> >Date: Mon, 20 Nov 2023 11:09:11 +0800 >Subject: [PATCH] dns/coredns: fix hosts file can not be load from Corefile > >Change working directory to config directory before running service. >The cwd of coredns daemon was /, need to be changed to config directory where Corefile stays. >eg. >>example.com { >> hosts example.hosts { >> reload 300s >> fallthrough >> } >>} >example.hosts file now can be placed in config directory(/usr/local/etc/coredns, by default). >--- > dns/coredns/Makefile | 2 +- > dns/coredns/files/coredns.in | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/dns/coredns/Makefile b/dns/coredns/Makefile >index 40f25e516503..16034b7653c8 100644 >--- a/dns/coredns/Makefile >+++ b/dns/coredns/Makefile >@@ -1,24 +1,24 @@ > PORTNAME= coredns > DISTVERSIONPREFIX= v > DISTVERSION= 1.11.1 >-PORTREVISION= 1 >+PORTREVISION= 2 > CATEGORIES= dns > > MAINTAINER= yuri@FreeBSD.org > COMMENT= DNS server that chains plugins > WWW= https://coredns.io/ > > LICENSE= APACHE20 > LICENSE_FILE= ${WRKSRC}/LICENSE > > USES= go:modules > > GO_MODULE= github.com/${PORTNAME}/${PORTNAME} > > USE_RC_SUBR= ${PORTNAME} > > PORTSCOUT= limit:^[0-9]*\.[0-9]*\.[0-9]*$$ # otherwise it picks up the deleted tag v011 > > post-install: > .for n in 1 5 7 > ${INSTALL_MAN} ${WRKSRC}/man/*.${n} ${STAGEDIR}${MANPREFIX}/man/man${n} >diff --git a/dns/coredns/files/coredns.in b/dns/coredns/files/coredns.in >index c7e998a02093..fb5af7605464 100644 >--- a/dns/coredns/files/coredns.in >+++ b/dns/coredns/files/coredns.in >@@ -20,25 +20,25 @@ > . /etc/rc.subr > > name=coredns > rcvar=coredns_enable > start_precmd="${name}_precmd" > > load_rc_config $name > > : ${coredns_enable:="NO"} > : ${coredns_config:="%%PREFIX%%/etc/coredns/Corefile"} > : ${coredns_listen_port:="53"} > > pidfile="/var/run/${name}.pid" > command="/usr/sbin/daemon" > procname="%%PREFIX%%/bin/${name}" > coredns_args="-conf ${coredns_config} -dns.port ${coredns_listen_port}" > command_args="-S -m 3 -s "info" -l "daemon" -p ${pidfile} /usr/bin/env ${procname} ${coredns_args}" > > coredns_precmd() > { >- /usr/bin/install -d -m 0755 \ >- %%PREFIX%%/etc/coredns >+ /usr/bin/install -d -m 0755 %%PREFIX%%/etc/coredns && \ >+ cfg_dir=$(dirname "${coredns_config}") && cd "$cfg_dir" > } > > run_rc_command "$1" >-- >2.42.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 275205
: 246435