Bug 501123

Summary: mod_fcgid installation stops httpd starting due to missing directory
Product: [Fedora] Fedora Reporter: Quentin Armitage <quentin>
Component: mod_fcgidAssignee: Paul Howarth <paul>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: low    
Version: rawhideCC: ansenlong, iarnell, paul, quentin, the.hw.group
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.2-11.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-20 00:47:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Quentin Armitage 2009-05-16 17:31:14 UTC
Description of problem:
yum install mod_fcgid does not create directory /etc/httpd/run/mod_fcgid. This causes httpd to fail to start with the error [Sat May 16 18:16:59 2009] [emerg] (2)No such file or directory: mod_fcgid: Can't create share memory for size %zu byte
If the directory is manually created, then httpd starts successfully.
Further, if the directory has been created manually, yum erase mod_fcgid fails to remove the directory.

Version-Release number of selected component (if applicable):
mod_fcgid.i586 0:2.2-10.fc11

How reproducible:
Always

Steps to Reproduce:
1. yum erase mod_fcgid
2. rm /etc/httpd/run/mod_fcgid
3. yum install mod_fcgid
4. service httpd start
  
Actual results:
httpd is not running, and "[Sat May 16 18:16:59 2009] [emerg] (2)No such file or directory: mod_fcgid: Can't create share memory for size %zu byte" appears in the error_log.

Expected results:
httpd runs successfully

Additional info:
See bug #500143

Comment 1 Paul Howarth 2009-05-16 20:05:19 UTC
The mod_fcgid package requires httpd as a dependency, and that package includes a symlink /etc/httpd/run -> ../../var/run so /etc/httpd/run/mod_fcgid is actually /var/run/mod_fcgid, which is correctly owned by the mod_fcgid package.

How have you managed to avoid this?

Comment 2 Quentin Armitage 2009-05-16 20:35:16 UTC
I have:
[root@samson httpd]# ls -l /etc/httpd/run
lrwxrwxrwx. 1 root root 19 2009-03-31 01:43 /etc/httpd/run -> ../../var/run/httpd

and this is generated from the lines in httpd.spec under %install:
# symlinks for /etc/httpd
ln -s ../..%{_localstatedir}/log/httpd $RPM_BUILD_ROOT/etc/httpd/logs
ln -s ../..%{_localstatedir}/run/httpd $RPM_BUILD_ROOT/etc/httpd/run
ln -s ../..%{_libdir}/httpd/modules $RPM_BUILD_ROOT/etc/httpd/modules

and so /etc/httpd/run/mod_fcgid is actually /var/run/httpd/mod_fcgid

I confirm that I do have a directory /var/run/mod_fcgid but the symlinks set out above do not get us there.

Comment 3 Paul Howarth 2009-05-16 20:49:18 UTC
Ah, this has changed since F-10:

* Thu Jan 22 2009 Joe Orton <jorton@redhat.com> 2.2.11-6
...
- change /etc/httpd/run symlink to have destination /var/run/httpd,
  and restore "run/httpd.conf" as default PidFile (#478688)
...
* Thu Dec 18 2008 Joe Orton <jorton@redhat.com> 2.2.11-3
- update to 2.2.11
- package new /var/run/httpd directory, and move default pidfile
  location inside there

I propose to update mod_fcgid in F-11 onwards to package directory /var/run/httpd/mod_fcgid instead of /var/run/mod_fcgid

That should get us back largely to where we were in F-10 and shouldn't need any SELinux policy updates or config file changes.

Comment 4 Joe Orton 2009-05-16 22:19:59 UTC
*** Bug 500143 has been marked as a duplicate of this bug. ***

Comment 5 Fedora Update System 2009-05-17 11:18:58 UTC
mod_fcgid-2.2-11.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/mod_fcgid-2.2-11.fc11

Comment 6 Fedora Update System 2009-05-19 02:06:38 UTC
mod_fcgid-2.2-11.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update mod_fcgid'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-5106

Comment 7 Fedora Update System 2009-05-20 00:47:24 UTC
mod_fcgid-2.2-11.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Joe Orton 2009-05-21 12:01:04 UTC
*** Bug 501931 has been marked as a duplicate of this bug. ***

Comment 9 Iain Arnell 2009-05-23 12:39:04 UTC
This is still not quite right.  Permissions on /var/run/httpd don't allow apache user to traverse the directory, so mod_fcgid can't create or access anything below that (see bug #502273).

$ rpm -q httpd mod_fcgid
httpd-2.2.11-8.x86_64
mod_fcgid-2.2-11.fc12.x86_64

$ rpm -qlv httpd | grep var/run
lrwxrwxrwx    1 root    root   19 Mar 17 14:16 /etc/httpd/run -> ../../var/run/httpd
drwx------    2 root    root    0 Mar 17 14:16 /var/run/httpd