Bug 2165485 - named.service fails to start: directory '/var/named' is not writable because named_write_master_zones is automatically switched off
Summary: named.service fails to start: directory '/var/named' is not writable because ...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: bind9-next
Version: 39
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Menšík
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-30 09:09 UTC by Petr Pisar
Modified: 2023-08-16 07:06 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Pisar 2023-01-30 09:09:29 UTC
named.service of bind9-next-32:9.19.9-2.fc36.x86_64 fails to start because it insists that "directory" option value (/var/named) must be writable, but SELinux policy (selinux-policy-36.17-1.fc36) reject the write access:

led 30 09:22:48 island named[477789]: loading configuration from '/etc/named.conf'
led 30 09:22:48 island audit[477789]: AVC avc:  denied  { write } for  pid=477789 comm="named" name="named" dev="dm-1" ino=263222 scontext=system_u:system_r:named_t:s0 tcontext=system_u:object_r:named_zone_t:s0 tclass=dir permissive=0
led 30 09:22:48 island named[477789]: directory '/var/named' is not writable
led 30 09:22:48 island named[477789]: /etc/named.conf:13: parsing failed: permission denied
led 30 09:22:48 island named[477789]: loading configuration: permission denied
led 30 09:22:48 island named[477789]: exiting (due to fatal error)
led 30 09:22:48 island systemd[1]: named.service: Control process exited, code=exited, status=1/FAILURE
led 30 09:22:48 island systemd[1]: named.service: Failed with result 'exit-code'.
led 30 09:22:48 island systemd[1]: Failed to start named.service - Berkeley Internet Name Domain (DNS).

# ls -ldZ /var/named
drwxrwx--T. 5 root named system_u:object_r:named_zone_t:s0 4096 30. led 09.16 /var/named

Comment 1 Petr Menšík 2023-01-30 13:43:55 UTC
Running with non-writeable working directory is not supported by upstream for quite a long time. We have changed the default value of SELinux boolean named_write_master_zones to on, which is the default. Unfortunately selinux boolean macros used in bind f36 package do not restore it back to default value, but to the value present when those macros were first used on that system.

It should make additional action on bind uninstallation and call "setsebool -P named_write_master_zones on".

I think it is more responsibility of bind package to reset it to working value. Or maybe even better to ignore that boolean altogether and change selinux-policy to always allow writing into /var/named, because all recent versions simply cannot work without it.

Comment 2 Petr Pisar 2023-02-01 08:11:17 UTC
I confirm the cause is named_write_master_zones boolean. The boolean gets switched off when installing bind9-next with "dnf swap bind bind9-next". After manually enabling the boolean, bind9-next starts successfully.

Comment 3 Ben Cotton 2023-04-25 18:18:28 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 4 Petr Menšík 2023-04-26 14:12:19 UTC
Still an issue even in the latest version

Comment 5 Rudd-O DragonFear 2023-04-27 09:35:22 UTC
Still an issue in F37 too.

Comment 6 Fedora Release Engineering 2023-08-16 07:06:31 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.


Note You need to log in before you can comment on or make changes to this bug.