ROOM AND PURPOSE
There is this topic about Passenger / mod _rails does not start in Fedora 12 when Apache starts . Bottom line, the problem is related to resolution, and you can avoid this by calling
setenforce 0
before launch
service httpd start
and challenge
setenforce 1
then install it. It works cool, but I want the sequence to start automatically when Fedora restarts.
PROBLEM
I looked through /etc/init.d/httpd and found that it just redirects to etc/rc.d/init.d/functions , and the key call
systemctl_redirect $0 $1
So, I thought that just surrounding this call with setenforce calls like this would work.
setenforce 0 systemctl_redirect $0 $1 setenforce 1
But that will not work. It generates a new error similar to this error (in the httpd error log):
Cannot change the directory '/tmp/passenger.1.0.8581/generation-0/buffered_uploads' its UID to 48 and GID to 48: Operation not permitted (1)
When I omit the last setenforce 1 , it finally works! But obviously, I want to get it back somewhere.
Question
How can I connect these calls to setenforce 0 and setenforce 1 to the httpd boot sequence? I feel that the most correct way would be to write your own /etc/init.d/httpd script that does not use systemctl , but I want to avoid this because it looks like a thorny path ... But if I am wrong and if you can offer an easy way to write my own etc/init.d/httpd script, I would also appreciate this.
source share