Description of problem: I tried to start lighttpd with systemd when booting with an empty /var. Since lighttpd doesn't try to create the log directory, I let systemd manage it with the following service addition. The SELinux policy prevents this. User=lighttpd Group=lighttpd LogsDirectory=lighttpd LogsDirectoryMode=0750 Version-Release number of selected component (if applicable): lighttpd-1.4.54-2.fc31.x86_64 selinux-policy-targeted-3.14.4-43.fc31.noarch systemd-243.5-1.fc31.x86_64 How reproducible: Always Steps to Reproduce: 1. Add the above lines to lighttpd.service (and enable it) 2. Configure var.state_dir="/run/lighttpd" to fix permissions 3. Boot with empty /var, or start the service after deleting /var/log/lighttpd Actual results: Jan 10 10:06:05 io audit[8669]: AVC avc: denied { create } for pid=8669 comm="(lighttpd)" name="lighttpd" scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:httpd_log_t:s0 tclass=dir permissive=1 Jan 10 10:06:05 io kernel: audit: type=1400 audit(1578668765.717:4733): avc: denied { create } for pid=8669 comm="(lighttpd)" name="lighttpd" scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:httpd_log_t:s0 tclass=dir permissive=1 Jan 10 10:06:05 io kernel: audit: type=1400 audit(1578668765.717:4734): avc: denied { setattr } for pid=8669 comm="(lighttpd)" name="lighttpd" dev="tmpfs" ino=323355 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:httpd_log_t:s0 tclass=dir permissive=1 Jan 10 10:06:05 io audit[8669]: AVC avc: denied { setattr } for pid=8669 comm="(lighttpd)" name="lighttpd" dev="tmpfs" ino=323355 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:httpd_log_t:s0 tclass=dir permissive=1 Expected results: The service should start with functioning logs.
commit 9e0b4dd06e1de366a0ca53e879bf3069a64b654b (HEAD -> rawhide, origin/rawhide) Author: Nikola Knazekova <nknazeko> Date: Thu Jan 30 11:47:16 2020 +0100 Allow init_t to create apache log dirs. PR for new apache create log dirs macro: https://github.com/fedora-selinux/selinux-policy-contrib/pull/194 Fixed Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1789868 $ rpm -qa selinux-policy selinux-policy-3.14.5-20.fc32.noarch $ sesearch -A -s init_t -t httpd_log_t -p create -c dir Scratch build installed $ rpm -qa selinux-policy selinux-policy-3.14.5-21.fc32.100.noarch $ sesearch -A -s init_t -t httpd_log_t -p create -c dir allow init_t httpd_log_t:dir { add_name create link remove_name rename reparent rmdir setattr unlink write };
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle. Changing version to 32.
This message is a reminder that Fedora 32 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25. 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 Fedora 'version' of '32'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 32 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, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.