Note that there are some explanatory texts on larger screens.

plurals
  1. POBoot Apache with Passenger/mod_rails successfully when Fedora starts up
    primarykey
    data
    text
    <p><strong>PREMISE and PURPOSE</strong></p> <p>There is this thread about <a href="https://stackoverflow.com/questions/2054554/passenger-mod-rails-fails-to-initialize-in-fedora-12-when-starting-apache">Passenger/mod_rails fails to initialize in Fedora 12 when starting Apache</a> . Bottom line, the problem is due to the permission, and you can avoid this by calling</p> <pre><code>setenforce 0 </code></pre> <p>before running</p> <pre><code>service httpd start </code></pre> <p>and calling</p> <pre><code>setenforce 1 </code></pre> <p>after that to set it back. It works cool, but I want the sequence to run automatically when Fedora restarts.</p> <p><br/><br/> <strong>PROBLEM</strong></p> <p>I looked into <code>/etc/init.d/httpd</code> and found out it just redirects to <code>etc/rc.d/init.d/functions</code>, and the key call is </p> <pre><code>systemctl_redirect $0 $1 </code></pre> <p>So, I thought simply surrounding this call with <code>setenforce</code> calls like this would work.</p> <pre><code>setenforce 0 systemctl_redirect $0 $1 setenforce 1 </code></pre> <p>But it does not work. It emits new error like this (in httpd error log) :</p> <pre><code>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) </code></pre> <p>When I omit the last <code>setenforce 1</code>, then it finally works! But obviously I want to set it back somewhere.</p> <p><br/><br/></p> <p><strong>QUESTION</strong></p> <p>How can I hook these <code>setenforce 0</code> and <code>setenforce 1</code> calls to the booting sequence of <code>httpd</code>? I am feeling that the most proper way would be to write my own <code>/etc/init.d/httpd</code> script that does not use <code>systemctl</code>, but I want to avoid that since it looks like a thorny path... But if I am wrong and if you can suggest easy way of writing my own <code>etc/init.d/httpd</code> script, I would appreciated that too.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload