Bug 1774028

Summary: No error message shown, when trying to start dnsmasq and port is already used by another process
Product: [Fedora] Fedora Reporter: Tomáš Hozza <thozza>
Component: dnsmasqAssignee: Petr Menšík <pemensik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: code, dougsland, itamar, jima, laine, p, pemensik, sfroemer, veillard
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: x86_64   
OS: All   
Whiteboard:
Fixed In Version: dnsmasq-2.85-1.fc33 dnsmasq-2.85-1.fc32 dnsmasq-2.85-1.fc34 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1741806 Environment:
Last Closed: 2021-04-23 19:01:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomáš Hozza 2019-11-19 13:11:31 UTC
+++ This bug was initially created as a clone of Bug #1741806 +++

Description of problem:
Starting the dnsmasq.service, when port 53 is already used by another process, the command is returning exitvalue 0 and failing silently.

Version-Release number of selected component (if applicable):
dnsmasq-2.76-9.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. Install RHEL 7.6
2. yum install dnsmasq -y
3. python -m SimpleHTTPServer 53
4. systemctl start dnsmasq

Actual results:
Service fail to start silently. No output shown

Expected results:
# systemctl start dnsmasq
Job for dnsmasq.service failed because the control process exited with error code. See "systemctl status dnsmasq.service" and "journalctl -xe" for details.


Additional info:
[root@localhost ~]# systemctl start dnsmasq
[root@localhost ~]# echo $?
0
[root@localhost ~]# systemctl start httpd                                                                              
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[root@localhost ~]# echo $?                                                                                            
1

--- Additional comment from Petr Menšík on 2019-08-23 17:06:15 CEST ---

It is visible in systemctl dnsmasq status. But I admit that is not great way to check it.

It would require change of systemd service unit from Type=simple to forking or notify. Both implement status check and report if daemon fails.

I think notify is better alternative for systemd services is Type=notify, but no support for it exists in upstream. It should change way it switches to unprivileged user if abrt catching of core dumps should not break.
dnsmasq forks already second process, but not in way that can be reused for checking status on startup. Might be a little easier, but I think it is already considered superseded by notify. This is also not supported in current code.
Either way requires new code for reporting failure before serving requests.

Comment 1 Fedora Update System 2021-04-08 09:01:30 UTC
FEDORA-2021-5cd2571751 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-5cd2571751

Comment 2 Fedora Update System 2021-04-08 09:03:54 UTC
FEDORA-2021-62a5062b2d has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-62a5062b2d

Comment 3 Fedora Update System 2021-04-08 09:04:24 UTC
FEDORA-2021-9433bedebd has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-9433bedebd

Comment 4 Fedora Update System 2021-04-08 19:06:02 UTC
FEDORA-2021-5cd2571751 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-5cd2571751`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-5cd2571751

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2021-04-08 20:58:54 UTC
FEDORA-2021-62a5062b2d has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-62a5062b2d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-62a5062b2d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2021-04-08 21:26:56 UTC
FEDORA-2021-9433bedebd has been pushed to the Fedora 32 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-9433bedebd`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-9433bedebd

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2021-04-23 19:01:26 UTC
FEDORA-2021-62a5062b2d has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2021-04-24 18:22:59 UTC
FEDORA-2021-9433bedebd has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2021-04-24 19:47:03 UTC
FEDORA-2021-5cd2571751 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2021-04-24 20:07:14 UTC
FEDORA-2021-5cd2571751 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.