Re: Race Condition Causes dnsmasq to Fail to Start By NetworkManager

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Am 16.03.2013 23:37, schrieb Garry T. Williams:
> I occasionally hit this when transitioning to a VPN connection or
> shutting one down:
> 
>     Mar 16 17:19:29 vfr NetworkManager[559]: <info> VPN connection 'cbeyond' (IP Config Get) complete.
>     Mar 16 17:19:29 vfr NetworkManager[559]: <info> Policy set 'Built-in Ethernet' (em1) as default for IPv4 routing and DNS.
>     Mar 16 17:19:29 vfr NetworkManager[559]: <info> DNS: starting dnsmasq...
>     Mar 16 17:19:29 vfr dnsmasq[740]: exiting on receipt of SIGTERM
>     Mar 16 17:19:29 vfr dnsmasq[31273]: failed to create listening socket for 127.0.0.1: Address already in use
>     Mar 16 17:19:29 vfr dnsmasq[31273]: FAILED to start up
>     Mar 16 17:19:30 vfr NetworkManager[559]: <info> VPN plugin state changed: started (4)
>     Mar 16 17:19:30 vfr dbus[610]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
>     Mar 16 17:19:30 vfr NetworkManager[559]: <warn> dnsmasq exited with error: Network access problem (address in use; permissions; etc) (2)
> 
> It seems that NM kills the running dnsmasq and then restarts it.  The
> new instance sometimes fails to bind because the old instance hasn't
> finished closing the port.
> 
> My work-around is to:
> 
>     sudo systemctl start dnsmasq.service
> 
> when I notice the failure.
> How can I eliminate this race?

systemd supports auto-restart of services and nobody knows why
it is not used as default while i have it for ANY service
since Fedora 15 in production use

yes, it's a workaround but it should work without user interaction
and since i avoid NetworkManager and use the classical "network.service"
with a static config nor have installed NM on anymachine.............

* FIRST: systemctl disable dnsmasq.service
* create /etc/systemd/system/dnsmasq.service
* systemctl daemon-reload
* systemctl enable dnsmasq.service
* systemctl restart dnsmasq.service

[root@proxy:~]$ cat /etc/systemd/system/dnsmasq.service
[Unit]
Description=DNS caching server
After=network.target network.service

[Service]
Type=forking
EnvironmentFile=-/etc/sysconfig/network
ExecStart=/usr/sbin/dnsmasq
Restart=always
RestartSec=1

[Install]
WantedBy=multi-user.target


Attachment: signature.asc
Description: OpenPGP digital signature

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux