Software >> OS >> Unix >> Linux >> RHEL >> 7 >> How to disable dnsmasq from being autostarted by libvirtd service





[root@rhel7client1 ~]# systemctl status libvirtd

● libvirtd.service - Virtualization daemon

   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)

   Active: active (running) since Thu 2020-12-10 11:06:26 +08; 3s ago

     Docs: man:libvirtd(8)

           https://libvirt.org

Main PID: 2946 (libvirtd)

    Tasks: 19 (limit: 32768)

   CGroup: /system.slice/libvirtd.service

          ├─2946 /usr/sbin/libvirtd

           ├─3037 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=...

           └─3038 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=...

 

Dec 10 11:06:28 rhel7client1 dnsmasq[3034]: listening on virbr0(#5): 192.168.122.1

Dec 10 11:06:28 rhel7client1 dnsmasq[3037]: started, version 2.76 cachesize 150

Dec 10 11:06:28 rhel7client1 dnsmasq[3037]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN DHCP DHCPv6...otify

Dec 10 11:06:28 rhel7client1 dnsmasq-dhcp[3037]: DHCP, IP range 192.168.122.2 -- 192.168.122.254, lease time 1h

Dec 10 11:06:28 rhel7client1 dnsmasq-dhcp[3037]: DHCP, sockets bound exclusively to interface virbr0

Dec 10 11:06:28 rhel7client1 dnsmasq[3037]: reading /etc/resolv.conf

Dec 10 11:06:28 rhel7client1 dnsmasq[3037]: using nameserver 192.168.1.254#53

Dec 10 11:06:28 rhel7client1 dnsmasq[3037]: read /etc/hosts - 5 addresses

Dec 10 11:06:28 rhel7client1 dnsmasq[3037]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses

Dec 10 11:06:28 rhel7client1 dnsmasq-dhcp[3037]: read /var/lib/libvirt/dnsmasq/default.hostsfile

Hint: Some lines were ellipsized, use -l to show in full.

 

[root@rhel7client1 ~]# virsh net-list --all

Name                 State      Autostart     Persistent

----------------------------------------------------------

default              active     yes           yes

 

[root@rhel7client1 ~]#  virsh net-autostart --disable default

Network default unmarked as autostarted

 

[root@rhel7client1 ~]# virsh net-list --all

Name                 State      Autostart     Persistent

----------------------------------------------------------

default              active     no            yes

 

[root@rhel7client1 ~]# virsh net-destroy default

Network default destroyed

 

[root@rhel7client1 ~]# virsh net-list --all

Name                 State      Autostart     Persistent

----------------------------------------------------------

default              inactive   no            yes

 

[root@rhel7client1 ~]# ps -ef | grep dnsmasq

root      3269  2815  0 11:07 pts/0    00:00:00 grep --color=auto dnsmasq

 

 

Next time you restart libvirtd, it will not start dnsmasq. 

 

[root@rhel7client1 ~]# systemctl restart libvirtd

[root@rhel7client1 ~]# systemctl status libvirtd

● libvirtd.service - Virtualization daemon

   Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)

   Active: active (running) since Thu 2020-12-10 11:09:52 +08; 6s ago

     Docs: man:libvirtd(8)

           https://libvirt.org

Main PID: 3309 (libvirtd)

    Tasks: 17 (limit: 32768)

   CGroup: /system.slice/libvirtd.service

           └─3309 /usr/sbin/libvirtd

 

Dec 10 11:09:52 rhel7client1 systemd[1]: Starting Virtualization daemon...

Dec 10 11:09:52 rhel7client1 systemd[1]: Started Virtualization daemon.

Dec 10 11:09:52 rhel7client1 libvirtd[3309]: 2020-12-10 03:09:52.902+0000: 3325: info : libvirt version: 4.5.0....com)

Dec 10 11:09:52 rhel7client1 libvirtd[3309]: 2020-12-10 03:09:52.902+0000: 3325: info : hostname: rhel7client1

Dec 10 11:09:52 rhel7client1 libvirtd[3309]: 2020-12-10 03:09:52.902+0000: 3325: error : virHostCPUGetTscInfo:...ctory

Dec 10 11:09:52 rhel7client1 libvirtd[3309]: 2020-12-10 03:09:52.911+0000: 3325: error : virHostCPUGetTscInfo:...ctory

Dec 10 11:09:52 rhel7client1 libvirtd[3309]: 2020-12-10 03:09:52.912+0000: 3325: error : virHostCPUGetTscInfo:...ctory

Hint: Some lines were ellipsized, use -l to show in full.

 

[root@rhel7client1 ~]# ps -ef | grep dnsmasq

root      3368  2815  0 11:10 pts/0    00:00:00 grep --color=auto dnsmasq