Gentoo Archives: gentoo-hardened

From: Albert Lash <alby@××××××××.net>
To: gentoo-hardened@l.g.o
Subject: [gentoo-hardened] SELinux and Apache - no pid file?
Date: Thu, 06 Oct 2005 18:09:24
Message-Id: Pine.LNX.4.58.0510061405510.18391@thirteen.net
In Reply to: Re: [gentoo-hardened] gcc-config by Albert Lash
1 Hi all,
2
3 I'm running an SELinux base system (followed the AMD64 howto for changing
4 a normal Gentoo system to a SELinux Gentoo system) with Apache2.
5
6 I keep the files accessed by Apache in a different directory than those
7 prescribed by the file contexts, so I added some regexp filters to
8 properly label my files, which seems to have worked, and I can access the
9 files via Apache without getting denials in /var/log/messages. (I am
10 running permissive mode right now).
11
12 The problem I am experiencing is when I restart apache. I do this as root,
13 su'd from a user with SELinux role staff_r and sysadm_r. I first login via
14 ssh as a normal user, then I newrole -r sysadm_r, then I su, and then I
15 /etc/init.d/apache2 restart. I get a warning that there is not pid. So
16 then I have to kill the process identified by ps -A, and then
17 /etc/init.d/apache start. (Whenever I run an init script, I have to
18 authenticate as the original user who has the sysadm_r role). The server
19 starts fine, but seems to have a delay before I can access the server via
20 a browser. Even when the server starts responding to browser requests, no
21 pid file is written to /var/run. There aren't even any denials in the
22 /var/log/messages files, which still wouldnt' prevent a pid file from
23 getting written, as I am in permissive mode.
24
25 I have also tried the SELinux run_init command before the ini script with
26 the same results.
27
28 Is this standard behavior for Apache2 on SELinux? I doubt it since I am
29 running another non-SELinux server which creates the apache.pid file
30 every time. Any recommendations on how to get Apache starting,
31 restarting, and stopping properly?
32
33 Thank you!
34
35 Albert
36 --
37 gentoo-hardened@g.o mailing list

Replies

Subject Author
Re: [gentoo-hardened] SELinux and Apache - no pid file? Chris PeBenito <pebenito@g.o>