-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(installer): Added dnsmasq default configuration file #4568
Conversation
Signed-off-by: pierantoniomerlino <[email protected]>
@@ -103,6 +103,12 @@ if [ -d /usr/lib/NetworkManager/conf.d/ ]; then | |||
fi | |||
fi | |||
|
|||
# install dnsmasq default configuration | |||
if [ -f /etc/default/dnsmasq ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also check that we currently have dnsmasq
installed and perform this copy only if needed (we might have installed the alternative isc-dhcp-server
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can decide how to proceed here. This is a lazy approach: copy the file even if the package is not installed on the system. In that case the presence of the config file is harmless. Otherwise, we have to check if dnsmasq is installed (is the package name different according to the OSs?), and copy the file only if needed.
What do you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the lazy approach is the best
@@ -0,0 +1,3 @@ | |||
ENABLED=1 | |||
CONFIG_DIR=/etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we include .old
exclusion here? We might risk to have the /etc/default/dnsmasq.old
overriding ours.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean dnsmasq.old
in the same folder of dnsmasq
? I checked on my RPi and it seems to work. We can copy the backup file, but where?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait I made some confusion here. This directive tells dnsmasq
to accept as config files in /etc/dnsmasq.d
that do not end with .dpkg-dist
, .dpkg-old
, or .dpkg-new
? Does it make sense to change it to accept only .conf
? I think we can do it with CONFIG_DIR=/etc/dnsmasq.d,*.conf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation is:
By default search this drop directory for configuration options.
Libvirt leaves a file here to make the system dnsmasq play nice.
Comment out this line if you don't want this. The dpkg-* are file
endings which cause dnsmasq to skip that file. This avoids pulling
in backups made by dpkg.
CONFIG_DIR=/etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new
This is the default configuration in my RPi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-7, --conf-dir=[,......],
Read all the files in the given directory as configuration files. If extension(s) are given, any files which end in those extensions are skipped. Any files whose names end in ~ or start with . or start and end with # are always skipped. If the extension starts with * then only files which have that extension are loaded. So --conf-dir=/path/to/dir,*.conf loads all files with the suffix .conf in /path/to/dir. This flag may be given on the command line or in a configuration file. If giving it on the command line, be sure to escape * characters. Files are loaded in alphabetical order of filename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/dir/path,*.conf
matches all and only.conf
files./dir/path,.conf
matches all except.conf
files.
@@ -0,0 +1,3 @@ | |||
ENABLED=1 | |||
CONFIG_DIR=/etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait I made some confusion here. This directive tells dnsmasq
to accept as config files in /etc/dnsmasq.d
that do not end with .dpkg-dist
, .dpkg-old
, or .dpkg-new
? Does it make sense to change it to accept only .conf
? I think we can do it with CONFIG_DIR=/etc/dnsmasq.d,*.conf
Signed-off-by: pierantoniomerlino <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be working on Raspberry Pi 4, Raspbian 11.
* Added dnsmasq default configuration file Signed-off-by: pierantoniomerlino <[email protected]> * Updated dnsmasq file Signed-off-by: pierantoniomerlino <[email protected]> --------- Signed-off-by: pierantoniomerlino <[email protected]> (cherry picked from commit 3c27bd8)
…lease-5.3.0] (#4570) fix(installer): Added dnsmasq default configuration file (#4568) * Added dnsmasq default configuration file Signed-off-by: pierantoniomerlino <[email protected]> * Updated dnsmasq file Signed-off-by: pierantoniomerlino <[email protected]> --------- Signed-off-by: pierantoniomerlino <[email protected]> (cherry picked from commit 3c27bd8) Co-authored-by: Pierantonio Merlino <[email protected]>
This PR adds the
dnsmasq
default configuration file. The Kura installer will copy it in the/etc/default/
folder.