Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2120763

Summary: Restarting NM does not kill the dnsmasq instances when dns=none defined in NetworkManager.conf
Product: Red Hat Enterprise Linux 8 Reporter: Wen Liang <wenliang>
Component: NetworkManagerAssignee: Wen Liang <wenliang>
Status: CLOSED ERRATA QA Contact: Matej Berezny <mberezny>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.8CC: bgalvani, djasa, lrintel, rkhan, sfaye, sukulkar, till, vbenes
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: NetworkManager-1.40.10-1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 09:04:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
trace log none

Description Wen Liang 2022-08-23 17:10:54 UTC
Created attachment 1907171 [details]
trace log

Created attachment 1907171 [details]
trace log

Description of problem:
When dns=none defined in NetworkManager.conf and restarting the NM, the previous running dnsmasq instances are not killed by NM. 

Version-Release number of selected component (if applicable):
nmcli tool, version 1.41.0-30859.8959083784.el8
Red Hat Enterprise Linux release 8.7 Beta (Ootpa)


How reproducible:
always

Steps to Reproduce:
[root@beaker-networkmanager-custom-upstream-3126 NetworkManager-ci]# ps aux | grep dns
dnsmasq   260057  0.0  0.0  73356  2528 ?        S    12:24   0:00 dnsmasq --pid-file=/tmp/dhcp_inbr.pid --dhcp-leasefile=/tmp/dhcp_inbr.lease --listen-address=192.168.100.1 --dhcp-range=192.168.100.10,192.168.100.254,240 --interface=masq --bind-interfaces
dnsmasq   260081  0.0  0.0  73356  2592 ?        S    12:24   0:00 dnsmasq --pid-file=/tmp/dhcp_simbr.pid --dhcp-leasefile=/tmp/dhcp_simbr.lease --dhcp-range=10.16.1.10,10.16.1.254,240 --dhcp-range=2620:52:0:1086::10,2620:52:0:1086::1ff,slaac,64,240 --enable-ra --interface=simbr --bind-interfaces
dnsmasq   291880  0.0  0.1  73328  4604 ?        S    12:40   0:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/NetworkManager/dnsmasq.pid --listen-address=127.0.0.1 --cache-size=400 --clear-on-reload --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
root      261442  0.0  0.0 221944  1148 pts/0    S+   12:40   0:00 grep --color=auto dns


[root@beaker-networkmanager-custom-upstream-3126 NetworkManager-ci]# vi /etc/NetworkManager/NetworkManager.conf

[root@beaker-networkmanager-custom-upstream-3126 NetworkManager-ci]# systemctl restart NetworkManager
[root@beaker-networkmanager-custom-upstream-3126 NetworkManager-ci]# ps aux | grep dns
dnsmasq   260057  0.0  0.0  73356  2528 ?        S    12:24   0:00 dnsmasq --pid-file=/tmp/dhcp_inbr.pid --dhcp-leasefile=/tmp/dhcp_inbr.lease --listen-address=192.168.100.1 --dhcp-range=192.168.100.10,192.168.100.254,240 --interface=masq --bind-interfaces
dnsmasq   260081  0.0  0.0  73356  2592 ?        S    12:24   0:00 dnsmasq --pid-file=/tmp/dhcp_simbr.pid --dhcp-leasefile=/tmp/dhcp_simbr.lease --dhcp-range=10.16.1.10,10.16.1.254,240 --dhcp-range=2620:52:0:1086::10,2620:52:0:1086::1ff,slaac,64,240 --enable-ra --interface=simbr --bind-interfaces
dnsmasq   291880  0.0  0.1  73328  4604 ?        S    12:40   0:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/NetworkManager/dnsmasq.pid --listen-address=127.0.0.1 --cache-size=400 --clear-on-reload --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
root      261594  0.0  0.0 221944  1184 pts/0    S+   12:41   0:00 grep --color=auto dns
[root@beaker-networkmanager-custom-upstream-3126 NetworkManager-ci]# vi /etc/NetworkManager/NetworkManager.conf
[root@beaker-networkmanager-custom-upstream-3126 NetworkManager-ci]# NetworkManager --print-config
# NetworkManager configuration: /etc/NetworkManager/NetworkManager.conf (lib: 00-server.conf) (etc: 99-test.conf, 99-unmanage-orig.conf)
 
[main]
# rc-manager=symlink
# auth-polkit=true
# iwd-config-path=
no-auto-default=*
ignore-carrier=*
dns=none
debug=RLIMIT_CORE,fatal-warnings
dhcp=nettools
plugins=ifcfg-rh,keyfile
configure-and-quit=no
 
[keyfile]
unmanaged-devices=interface-name:orig-*
 
[logging]
# backend=journal
# audit=false
level=TRACE
domains=ALL
 
[device]
# wifi.backend=wpa_supplicant
 
# no-auto-default file "/var/lib/NetworkManager/no-auto-default.state"


Actual results:
The running of the dnsmasq instance started by NM is not killed.

Expected results:
The running of the dnsmasq instance started by NM should be killed.

Comment 3 Wen Liang 2022-12-22 18:48:25 UTC
The PR was merged in upstream, and I tested it, the running dnsmasq instance which started by NM was killed during restart when dns=none defined in NetworkManager.conf. Thus, change the state into `post`.

Comment 4 David Jaša 2022-12-22 20:40:27 UTC
Clear reproducer - qa_ack+

[root@rhel-87-nightly NetworkManager-ci]# cat << EOF > /etc/NetworkManager/conf.d/90-dnsmasq.conf
> [main]
> dns=dnsmasq
> EOF
[root@rhel-87-nightly NetworkManager-ci]# systemctl restart NetworkManager
[root@rhel-87-nightly NetworkManager-ci]# pgrep -laf dnsmasq
1914 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/NetworkManager/dnsmasq.pid --listen-address=127.0.0.1 --cache-size=400 --clear-on-reload --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
[root@rhel-87-nightly NetworkManager-ci]# rm /etc/NetworkManager/conf.d/90-dnsmasq.conf 
rm: remove regular file '/etc/NetworkManager/conf.d/90-dnsmasq.conf'? y
[root@rhel-87-nightly NetworkManager-ci]# systemctl restart NetworkManager
[root@rhel-87-nightly NetworkManager-ci]# pgrep -laf dnsmasq
1914 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/NetworkManager/dnsmasq.pid --listen-address=127.0.0.1 --cache-size=400 --clear-on-reload --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
[root@rhel-87-nightly NetworkManager-ci]# cat << EOF > /etc/NetworkManager/conf.d/90-dns-none.conf
[main]
dns=none   
EOF
[root@rhel-87-nightly NetworkManager-ci]# systemctl restart NetworkManager
[root@rhel-87-nightly NetworkManager-ci]# pgrep -laf dnsmasq
1914 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/NetworkManager/dnsmasq.pid --listen-address=127.0.0.1 --cache-size=400 --clear-on-reload --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d

tested using: NetworkManager-1.40.0-2.el8_7.x86_64

Comment 5 Beniamino Galvani 2023-01-11 15:26:49 UTC
The fix works for me, setting Verified:Tested:

  # grep dns= /etc/NetworkManager/NetworkManager.conf
  dns=dnsmasq

  # pgrep dnsmasq -a
  11949 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pid --listen-address=127.0.0.1 --cache-size=400 --clear-on-reload --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d

  # sed -i 's/dns=dnsmasq/dns=none/' /etc/NetworkManager/NetworkManager.conf

  # systemctl restart NetworkManager

  # pgrep dnsmasq -a
  #

Comment 10 errata-xmlrpc 2023-05-16 09:04:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (NetworkManager bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2968