OpenWFE as a service

This chapter is intended for sysadmins being tasked to install an instance of OpenWFE on a system.

OpenWFE as a linux service

A linux system usually places its services' start scripts in /etc/rc.d/ or /etc/init.d/. Here is an example of a start script for a Debian system. (OpenWFE is developed on Debian GNU/Linux).

Figure 4.1. OpenWFE Debian start script


#! /bin/sh

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

#
# may be necessary
#
#export JAVA_HOME=/usr/local/java

#OWFE_USER=toto
#OWFE_GROUP=toto

OWFE=/usr/local/owfe-suite.sh

NAME=openwfe
DESC="OpenWFE - Open source WorkFlow Engine"

SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0


case "$1" in
  start)
        echo "Starting $DESC: $NAME."
        #start-stop-daemon --start --quiet --chuid $OWFE_USER:$OWFE_GROUP --exec $OWFE
        start-stop-daemon --start --quiet --exec $OWFE
        ;;
  stop)
        echo "Stopping $DESC: $NAME."
        $OWFE stop
        ;;
  *)
        # echo "Usage: $SCRIPTNAME {start|stop}" >&2
        echo "Usage: $SCRIPTNAME {start|stop}" >&2
        exit 1
        ;;
esac

exit 0

You can see that in this example, OpenWFE has been deployed in /usr/local/openwfe and is run as the root user.

This script located at /etc/init.d/openwfe can then be chmod a+x /etc/init.d/openwfe and added to the services started at boot time with update-rc.d openwfe defaults. The service can then be manually started or stopped with /etc/init.d/openwfe start or invoke-rc.d openwfe start

OpenWFE as a windows service

(Maybe someone charitable will contribute this section, I myself run OpenWFE on GNU/Linux exclusively)