Versions Compared

Key

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

...

1. Create a linux user dedicated to run OFBiz (should NOT be root, for many good reasons that I will not go into here).  This user should have full permissions over OFBiz installation dir and its subdir (for simplicity, in fact you could tune this).  Your commands will be SOMETHING LIKE...

Code Block
useradd -m ofbiz
chown -R ofbiz /opt/ofbiz
chmod 700 /opt/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 "echo_" by "echo "

We may also rather use the following snippet. But, but as I'm not a Linux specialist, I let it here as an example for now...

Code Block
# 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 

4. Give this script the correct permissions.  Here is a typical example.

...