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.14 -r1.15 --- openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html 7 Aug 2017 23:47:50 -0000 1.14 +++ openacs-4/packages/acs-core-docs/www/install-openacs-inittab.html 8 Nov 2017 09:42:11 -0000 1.15 @@ -1,12 +1,20 @@ -AOLserver keepalive with inittab

AOLserver keepalive with inittab

This is an alternative method for keeping the 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.

+ 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 script doesn't actually restart AOLserver - it just kills @@ -15,7 +23,9 @@ Ask the OS to restart our service whenever it's not running. We do this by adding a line to /etc/inittab. -

        +

      + +

      Calling restart-aolserver kills our service. The OS notices that our service is not running, so it automatically restarts it. Thus, calling @@ -34,27 +44,33 @@ 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. -

      +		  

      +
       [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
    • +[root ~]# exit +

    • 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 it. If it works, then there should be no more servers - running. You should see the following lines.

      +			running. You should see the following lines. 

      + +
       [joeuser ~]$ killall nsd
       nsd: no process killed
       [joeuser ~]$ /usr/local/aolserver/bin/nsd-postgres -t ~/var/lib/aolserver/birdnotes/nsd.tcl
       [joeuser ~]$ restart-aolserver birdnotes
       Killing 23727 
       [joeuser ~]$ killall nsd
      -nsd: no process killed

      +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 @@ -63,30 +79,43 @@ Assuming that the restart-aolserver script worked, login as root and open /etc/inittab for - editing.

      +          editing. 

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

    • Copy this line into the bottom of the file as a template, making sure that the first field 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
    • +

      +
      +nss1:345:respawn:/usr/local/aolserver/bin/nsd-postgres -i -u nobody -g web -t /home/joeuser/var/lib/aolserver/birdnotes/nsd.tcl
      +
    • 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.

    • 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
    • +[root ~]# /sbin/init q +

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

      +            again. 

      + +
       [root ~]# restart-aolserver birdnotes
      -Killing 23750

    +Killing 23750 +

+ +

If processes were killed, congratulations, your server is now automated for startup and shutdown. -

+

+