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.10 -r1.10.2.1 --- openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html 13 Sep 2009 23:54:40 -0000 1.10 +++ openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html 12 Dec 2010 00:07:02 -0000 1.10.2.1 @@ -1,51 +1,51 @@ - -AOLserver keepalive with inittab

AOLserver keepalive with inittab

This is an alternative method for keeping the AOLserver - process running. The recommended method is to run AOLserver + +AOLserver keepalive with inittab

AOLserver keepalive with inittab

This is an alternative method for keeping the AOLserver + process running. The recommended method is to run AOLserver supervised.

This step should be completed as root. This can break every service on your machine, so proceed with caution. -

  • +

    • There are 2 general steps to getting this working. -

      1. +

        1. Install a script called - restart-aolserver. This + restart-aolserver. This script doesn't actually restart AOLserver - it just kills it. -

        2. +

        3. Ask the OS to restart our service whenever it's not running. We do this by adding a line to - /etc/inittab. + /etc/inittab.

        - Calling restart-aolserver + Calling restart-aolserver kills our service. The OS notices that our service is not running, so it automatically restarts it. Thus, calling - restart-aolserver effectively + restart-aolserver effectively restarts our service. -

      2. - Copy this file into - /var/tmp/restart-aolserver.txt. -

      3. +

      4. + Copy this file into + /var/tmp/restart-aolserver.txt. +

      5. 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 - web group to ensure that the + web 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 - /usr/local/bin. + /usr/local/bin.

         [joeuser ~]$ su - 
         Password: ***********
         [root ~]# cp /var/tmp/restart-aolserver.txt /usr/local/bin/restart-aolserver
         [root ~]# chown root.web /usr/local/bin/restart-aolserver
         [root ~]# chmod 4750 /usr/local/bin/restart-aolserver
         [root ~]# ln -s /usr/bin/perl /usr/local/bin/perl
        -[root ~]# exit
      6. - Test the restart-aolserver +[root ~]# exit

      7. + Test the restart-aolserver script. We'll first kill all running servers to clean the slate. Then, we'll start one server and use - restart-aolserver to kill + restart-aolserver to kill it. If it works, then there should be no more servers running. You should see the following lines.

         [joeuser ~]$ killall nsd
        @@ -56,34 +56,34 @@
         [joeuser ~]$ killall nsd
         nsd: no process killed

        The number 23727 indicates the process id(s) (PIDs) of the - processes being killed. It is important that no processes are killed by the second - call to killall. If there are + processes being killed. It is important that no processes are killed by the second + call to killall. If there are processes being killed, it means that the script is not - working.

      8. - Assuming that the restart-aolserver + working.

      9. + Assuming that the restart-aolserver script worked, login as root and open - /etc/inittab for + /etc/inittab for editing.

         [joeuser ~]$ su -
         Password: ************
        -[root ~]# emacs -nw /etc/inittab
      10. +[root ~]# emacs -nw /etc/inittab

      11. Copy this line into the bottom of the file as a template, making sure that the first field - nss1 is unique. + nss1 is unique.

        -nss1:345:respawn:/usr/local/aolserver/bin/nsd-postgres -i -u nobody -g web -t /home/joeuser/var/lib/aolserver/birdnotes/nsd.tcl
      12. - Important: Make sure there is a +nss1:345:respawn:/usr/local/aolserver/bin/nsd-postgres -i -u nobody -g web -t /home/joeuser/var/lib/aolserver/birdnotes/nsd.tcl

      13. + Important: 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. -

      14. +

      15. Still as root, enter the following command to re-initialize - /etc/inittab.

        +            /etc/inittab. 

         [root ~]# killall nsd    
         nsd: no process killed
        -[root ~]# /sbin/init q
      16. +[root ~]# /sbin/init q

      17. See if it worked by running the - restart-aolserver script + restart-aolserver script again.

         [root ~]# restart-aolserver birdnotes
         Killing 23750