From: Sergey Trofimov <sarg@sarg.org.ru>
To: 61956@debbugs.gnu.org
Cc: Andrew Tropin <andrew@trop.in>
Subject: [bug#61956] [PATCH v2] services: dns: Extend dnsmasq-configuration.
Date: Fri, 10 Mar 2023 09:38:05 +0100 [thread overview]
Message-ID: <87356d2dju.fsf@sarg.org.ru> (raw)
In-Reply-To: <87ilf9cb5p.fsf@trop.in>
Andrew Tropin <andrew@trop.in> writes:
> [[PGP Signed Part:Undecided]]
> On 2023-03-04 09:40, Sergey Trofimov wrote:
>
> Hi Sergey!
>
> Thank you for the patch, please add information to the commit
> message
> body. Here is an example:
> https://git.savannah.gnu.org/cgit/guix.git/commit/?id=8390b47c04
>
I have pushed v3 with a proper description.
>> (servers dnsmasq-configuration-servers
>> (default '())) ;list of string
>> + (servers-file dnsmasq-configuration-servers-file
>> + (default #f)) ;string
>
> I would expect it to be a file-like rather than string, so we
> are sure
> that the configuration file is present. WDYT?
>
Hmm, my use-case is to generate this file in dhclient's hook, so
that dnsmasq knows the domain supplied with the DHCP
configuration.
Here is how I do that:
1. Define the hook which updates dnsmasq.servers and sends HUP to
the daemon
(define dhclient-enter-hooks "
make_resolv_conf() {
touch /etc/dnsmasq.servers
sed -i '/#dhcp/,+1d' /etc/dnsmasq.servers
cat <<EOF >>/etc/dnsmasq.servers
#dhcp
server=/${new_domain_name}/${new_domain_name_servers}
EOF
kill -HUP $(cat /run/dnsmasq.pid)
}
")
2. Register the file in operating-system -> services
(extra-special-file "/etc/dhclient-enter-hooks"
(plain-file "dhclient-enter-hooks"
dhclient-enter-hooks))
3. Add dnsmasq option
(servers-file "/etc/dnsmasq.servers")
Do you think making `servers-file` either string or file-like
would be a way to go?
next prev parent reply other threads:[~2023-03-10 8:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-04 8:27 [bug#61956] [PATCH] services: dns: Extend dnsmasq-configuration Sergey Trofimov
2023-03-04 8:40 ` [bug#61956] [PATCH v2] " Sergey Trofimov
2023-03-10 7:34 ` Andrew Tropin
2023-03-10 8:36 ` [bug#61956] [PATCH v3] " Sergey Trofimov
2023-03-10 8:38 ` Sergey Trofimov [this message]
2023-03-10 13:33 ` [bug#61956] [PATCH v4] " Sergey Trofimov
2023-03-10 15:00 ` [bug#61956] [PATCH v5] " Sergey Trofimov
2023-03-13 13:17 ` Andrew Tropin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87356d2dju.fsf@sarg.org.ru \
--to=sarg@sarg.org.ru \
--cc=61956@debbugs.gnu.org \
--cc=andrew@trop.in \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.