Index: openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html,v diff -u -r1.7 -r1.7.4.1 --- openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html 17 Jul 2006 05:38:31 -0000 1.7 +++ openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html 3 Feb 2008 12:07:39 -0000 1.7.4.1 @@ -1,4 +1,5 @@ -<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>AOLserver keepalive with inittab</title><meta name="generator" content="DocBook XSL Stylesheets V1.70.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="maintenance-web.html" title="Chapter�6.�Production Environments"><link rel="previous" href="install-openacs-keepalive.html" title="Starting and Stopping an OpenACS instance."><link rel="next" href="install-next-add-server.html" title="Running multiple services on one machine"><link rel="stylesheet" href="openacs.css" type="text/css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" border="0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="install-openacs-keepalive.html">Prev</a> </td><th width="60%" align="center">Chapter�6.�Production Environments</th><td width="20%" align="right"> <a accesskey="n" href="install-next-add-server.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="install-openacs-inittab"></a>AOLserver keepalive with inittab</h2></div></div></div><p>This is an alternative method for keeping the AOLserver +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>AOLserver keepalive with inittab</title><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="OpenACS Core Documentation"><link rel="up" href="maintenance-web.html" title="Chapter�6.�Production Environments"><link rel="previous" href="install-openacs-keepalive.html" title="Starting and Stopping an OpenACS instance."><link rel="next" href="install-next-add-server.html" title="Running multiple services on one machine"><link rel="stylesheet" href="openacs.css" type="text/css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><a href="http://openacs.org"><img src="/doc/images/alex.jpg" border="0" alt="Alex logo"></a><table width="100%" summary="Navigation header" border="0"><tr><td width="20%" align="left"><a accesskey="p" href="install-openacs-keepalive.html">Prev</a> </td><th width="60%" align="center">Chapter�6.�Production Environments</th><td width="20%" align="right"> <a accesskey="n" href="install-next-add-server.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="install-openacs-inittab"></a>AOLserver keepalive with inittab</h2></div></div><div></div></div><p>This is an alternative method for keeping the AOLserver process running. The recommended method is to <a href="install-openacs-keepalive.html" title="Starting and Stopping an OpenACS instance.">run AOLserver supervised</a>.</p><p> This step should be completed as root. This can break every service @@ -7,32 +8,32 @@ There are 2 general steps to getting this working. </p><div class="orderedlist"><ol type="1"><li><p> Install a script called - <code class="computeroutput">restart-aolserver</code>. This + <tt class="computeroutput">restart-aolserver</tt>. This script doesn't actually restart AOLserver - it just kills it. </p></li><li><p> Ask the OS to restart our service whenever it's not running. We do this by adding a line to - <code class="computeroutput">/etc/inittab</code>. + <tt class="computeroutput">/etc/inittab</tt>. </p></li></ol></div><p> - Calling <code class="computeroutput">restart-aolserver</code> + Calling <tt class="computeroutput">restart-aolserver</tt> kills our service. The OS notices that our service is not running, so it automatically restarts it. Thus, calling - <code class="computeroutput">restart-aolserver</code> effectively + <tt class="computeroutput">restart-aolserver</tt> effectively restarts our service. </p></li><li><p> Copy this <a href="files/restart-aolserver.txt" target="_top">file</a> into - <code class="computeroutput">/var/tmp/restart-aolserver.txt</code>. + <tt class="computeroutput">/var/tmp/restart-aolserver.txt</tt>. </p></li><li><p> This script needs to be SUID-root, which means that the script will run as root. This is necessary to ensure that the AOLserver processes are killed regardless of who owns them. However the script should be executable by the - <code class="computeroutput">web</code> group to ensure that the + <tt class="computeroutput">web</tt> group to ensure that the users updating the web page can use the script, but that general system users cannot run the script. You also need to have Perl installed and also a symbolic link to it in - <code class="computeroutput">/usr/local/bin</code>. + <tt class="computeroutput">/usr/local/bin</tt>. </p><pre class="programlisting"> [joeuser ~]$ su - Password: *********** @@ -41,10 +42,10 @@ [root ~]# chmod 4750 /usr/local/bin/restart-aolserver [root ~]# ln -s /usr/bin/perl /usr/local/bin/perl [root ~]# exit</pre></li><li><p> - Test the <code class="computeroutput">restart-aolserver</code> + Test the <tt class="computeroutput">restart-aolserver</tt> script. We'll first kill all running servers to clean the slate. Then, we'll start one server and use - <code class="computeroutput">restart-aolserver</code> to kill + <tt class="computeroutput">restart-aolserver</tt> to kill it. If it works, then there should be no more servers running. You should see the following lines. </p><pre class="programlisting"> [joeuser ~]$ killall nsd @@ -55,34 +56,34 @@ [joeuser ~]$ killall nsd nsd: no process killed</pre><p> The number 23727 indicates the process id(s) (PIDs) of the - processes being killed. It is important that <span class="strong"><strong>no processes are killed</strong></span> by the second - call to <code class="computeroutput">killall</code>. If there are + processes being killed. It is important that <span class="strong">no processes are killed</span> by the second + call to <tt class="computeroutput">killall</tt>. If there are processes being killed, it means that the script is not working.</p></li><li><p> - Assuming that the <code class="computeroutput">restart-aolserver</code> + Assuming that the <tt class="computeroutput">restart-aolserver</tt> script worked, login as root and open - <code class="computeroutput">/etc/inittab</code> for + <tt class="computeroutput">/etc/inittab</tt> for editing. </p><pre class="programlisting"> [joeuser ~]$ su - Password: ************ [root ~]# emacs -nw /etc/inittab</pre></li><li><p> Copy this line into the bottom of the file as a template, making sure that the first field - <code class="computeroutput">nss1</code> is unique. + <tt class="computeroutput">nss1</tt> is unique. </p><pre class="programlisting"> nss1:345:respawn:/usr/local/aolserver/bin/nsd-postgres -i -u nobody -g web -t /home/<span class="emphasis"><em>joeuser</em></span>/var/lib/aolserver/<span class="emphasis"><em>birdnotes</em></span>/nsd.tcl</pre></li><li><p> - <span class="strong"><strong>Important:</strong></span> Make sure there is a + <span class="strong">Important:</span> Make sure there is a newline at the end of the file. If there is not a newline at the end of the file, the system may suffer catastrophic failures. </p></li><li><p> Still as root, enter the following command to re-initialize - <code class="computeroutput">/etc/inittab</code>. </p><pre class="programlisting"> + <tt class="computeroutput">/etc/inittab</tt>. </p><pre class="programlisting"> [root ~]# killall nsd nsd: no process killed [root ~]# /sbin/init q</pre></li><li><p> See if it worked by running the - <code class="computeroutput">restart-aolserver</code> script + <tt class="computeroutput">restart-aolserver</tt> script again. </p><pre class="programlisting"> [root ~]# restart-aolserver <span class="emphasis"><em>birdnotes</em></span> Killing 23750</pre></li></ul></div><p>