Here's some information that I hope may help people running headless swikis
under Redhat Linux; it should be applicable to any Unix with some
thought, but won't be much if any use to those running a non-unix
platform. 

I'm running a FourStrongWinds Comanche Swiki on Redhat Linux 6.1,
starting it with a headless squeak upon boot.  It seems to be working
very well.  I found that Lex Spoon's network patches completely fixed
the problem with images not appearing.  He has Redhat binaries and
source (I've not tried the source) at:

    http://www.cc.gatech.edu/~lex/squeak/

I typically administer this machine remotely over a slow (<48k)
connection, and don't see it for weeks at time.  (The machine itself
has a fast connection to the Internet; unfortunately, I don't.)  I've
not had much luck with running X programs remotely over that
connection, and Squeak in particular seems very demanding.  So, to
initially install my Swiki I set it all up on my local machine, then
tarred it all up and ftp'ed it to the remote machine, where I untarred
it and started it up.

I've set up a user swiki and group swiki that is solely for running
the swiki.  It is a normal user account.  It's home directory has one
subdirectory, "squeak", which contains all the squeak executables and
other files for running squeak.  The squeak executable is Lex Spoon's
headless squeak.  the "squeak" subdirectory in turn has a "swiki"
subdirectory, which contains all unzipped contents of
FourStrongWinds.zip, plus the files for my swikis.

To set up the squeak image file for this swiki I started up a normal
squeak, followed the instructions in the FourStrongWinds.zip
ReadMe.txt, and at the end pressed the "save & exit" button on the
ComSwiki Launcher window.  After that I started up the headless
squeak with that image file and checked that the swiki worked
properly.  It did. :)   I added the swikis that I wanted using the
admin swiki, transfered everything to the remote machine, and started
it up there.  It worked. :)  Since then I've been able to do all the
swiki administration remotely through the admin swiki.

I've got an /etc/rc.d/init.d/swiki script that is symbolically linked
to /etc/rc.d/rc3.d/S86swiki so that a normal bootup starts the swiki:

    #! /bin/sh
    # swiki             This is the init script for starting up the Swiki server

    # Version 0.0  TKB
    # description:      Starts and stops the Swiki/squeak process that handles 
    #           all Swiki requests.
    # processname: squeak
    # pidfile: /var/run/squeak.pid ?
    #
    # This script was derived from the postgresql startup script from Redhat 6.1.
    # it has only been tested on Redhat 6.1.
    #

    # Source function library.
    . /etc/rc.d/init.d/functions

    # Get config.
    . /etc/sysconfig/network

    # Check that networking is up; have to have it for web serving.
    [ ${NETWORKING} = "no" ] && exit 0

    [ -f /home/swiki/squeak/squeak ] || exit 0

    # This script is slightly unusual in that the name of the daemon (squeak)
    # is not the same as the name of the subsystem (swiki)

    # See how we were called.
    case "$1" in
      start)
            # Check for squeak already running...
            pid=`pidof squeak`
            if [ $pid ]
            then
                    echo "squeak already running."
            else
                    #all systems go -- remove any stale lock files
                    echo -n "Starting swiki service: "
                    su -l swiki -c 'cd /home/swiki/squeak && ./squeak >Log.swiki-`date 
"+%Y-%m-%d-%H-%M-%S"`&'
                    sleep 1
                    pid=`pidof squeak`
                    if [ $pid ]
                    then
                            echo -n "squeak [$pid]"
                            touch /var/lock/subsys/swiki
                            echo $pid > /var/run/squeak.pid
                            echo
                    else
                            echo "failed."
                    fi
            fi
            ;;
      stop)
            echo -n "Stopping swiki service: "
            killproc squeak
            sleep 2
            rm -f /var/run/squeak.pid
            rm -f /var/lock/subsys/swiki
            echo
            ;;
      status)
            status squeak
            ;;
      restart)
            $0 stop
            $0 start
            ;;
      *)
            echo "Usage: swiki {start|stop|status|restart}"
            exit 1
    esac

    exit 0

A swiki is a marvelous thing. :)
-- 
T. Kurt Bond, [EMAIL PROTECTED]

Reply via email to