Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

2. Copy the rc.ofbiz script to the /etc/init.d directory, with the name ofbiz, so you end up with: /etc/init.d/ofbiz    .   For instance:

Code Block
cp /opt/ofbiz/rc.ofbiz /etc/init.d/ofbiz



3. Edit the various variables at the top of the script to reflect your environment, for instance where OFBiz is installed, where your JVM is installed, etc. 
For Debian based distrib use . /lib/lsb/init-functions as "Source function library" and replace replace all "echo_" by "echo "
We may rather use the following snippet. But, as I'm not a Linux specialist, I let it here as an example for now...

Code Block
# detect the distribution:
if [ -f /etc/redhat-release -o -f /etc/fedora-release ] ; then
    DISTRIBUTION="redhat"
elif [ -f /etc/SuSE-release ] ; then
    DISTRIBUTION="suse"
elif [ -f /etc/debian_version ] ; then
    DISTRIBUTION="debian"
else
    DISTRIBUTION="debian"
fi

# Source function library.
[ "$DISTRIBUTION" = "redhat" ] && . /etc/init.d/functions
[ "$DISTRIBUTION" = "suse" ] && . /etc/rc.status

if [ "$DISTRIBUTION" = "suse" ] ; then
    echo_success() {
        rc_status -v
    }
    echo_failure() {
        rc_status -v
    }
    success() {
        echo_success
    }
    failure() {
        echo_success
    }
elif [ "$DISTRIBUTION" = "debian" ] ; then
    echo_success() {
        echo ok
    }
    echo_failure() {
        echo failed
    }
    success() {
        echo_success
    }
    failure() {
        echo_success
    }
fi

...