Talk:Ubuntu Install Howto

From ADempiere
Revision as of 12:44, 31 May 2007 by Kf6kjg (Talk) (New init.d Script idea)

Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

Instead of instructions on how to export the java_home and compiere_home, maybe we had better install a start-up script, like:

#! /bin/sh -e
# /etc/init.d startup script for ADempiere
# path to JAVA_HOME, usually /usr/lib/jvm/java-1.5.0-sun
JAVA_HOME = /path/to/java_home
# path to ADempiere_home, usually ....
ADEMPIERE_HOME = /path/to/adempiere
# add to path
PATH=$JAVA_HOME/bin:ADEMPIERE_HOME/utils:$PATH
EXPORT JAVA_HOME, ADEMPIERE_HOME
# run ADempiere
/ADEMPIERE_HOME/utils/RUN_Server2.sh

And save it as adempiere.sh in /etc/init.d . Then, we update the start-up with the script

% update-rc.d adempiere defaults

and give it executable status

$chmod +x adempiere

Looks good.

I agree with the whole script idea. In the howto, I think that we should specify where they should install the jdk and such, that way its easier for newbies to follow, and the script is that much easier to write.

Well, it is a very basic script

Yes, the installation script should have as default the most usual parameters, and a comment on what to edit. So, i should have written:

# path to SUN Java SDK, edit according to your configuration and Java version

JAVA_HOME = /usr/lib/jvm/java-1.5.0-sun

And the same for ADEMPIERE_HOME. Anyway, I haven't tested it - I am using Ubuntu but I am still testing ADempiere on Windows.

But we can not specify where to install the JDK - when installing using .deb packages, all dirs are preconfigured.

Can we have a script that downloads/installs the jdk at part of the adempiere installer? It would be like how the jre2 installer is. Also, now that java is open source, could we include it with the installer?

Java install

Of course we can have a script to download Java (sudo apt-get install...) , but it will download a .deb package, and will install all files where the creator of the .deb package has decided to be installed. This is a good thing, because it standardises installations. Anyway, for Java 1.5.0 this is the right JAVA_HOME. Furthermore, the .deb package places a symbolic link "java-1.5.0-sun" which points to the JDK, irrelevant of the specific version. If we just point the JAVA_HOME to this, it is ok.

Repositories?

Should we set up a repository? This would make things incredibly easy for the user to install adempiere. I know that my life would have been easier if I could have just gone "sudo apt-get install adempiere" and had it do the rest. I know that it makes it considerably more difficult for the the developers, but I think that it will make it leaps and bounds easier for the end user. What do you think? We could also try to get this added into the ubuntu contribution repos if you think that we should try to persue that.

Hi Joe, u shuld sign the above. I like the words leaps and bounds. Tell Joel (US Data Centre) what u need. Let's make it happen! -- 16:34, 16 December 2006 (EST)
YES please, that would be really great. I am desperately trying to install ADempiere since yesterday but haven' succeeded until now. It is quite a hassle to set up Adempiere. Any support that makes the life for new users easyer would be a real improvement! Greetings, Tomakos 2007-05-01 (ISO)

.bashrc

Can't we add this to the bashrc file? Wouldn't that create the variables properly? - Joseph Brower

Enhanced init.d script

I just whipped together this init.d script for Adempiere. I am currently in process of installing adempiere, so I have not tested it, but I wanted to get your opinions. Kf6kjg 15:44, 31 May 2007 (EDT)

#! /bin/sh -e
# /etc/init.d startup script for ADempiere
#

# Script layout borrowed from anachron.

# path to JAVA_HOME, usually /usr/lib/jvm/java-1.5.0-sun
JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun

# path to ADempiere_home, usually /....?
ADEMPIERE_HOME=/usr/adempiere

# add to path
PATH=$JAVA_HOME/bin:$ADEMPIERE_HOME/utils:$PATH

export JAVA_HOME, ADEMPIERE_HOME


test -x $ADEMPIERE_HOME/utils/RUN_Server2.sh || exit 0

# Get lsb functions
. /lib/lsb/init-functions

case "$1" in
  start)
    log_daemon_msg "Starting Adempiere server" "adempiere"

    start-stop-daemon --start --exec $ADEMPIERE_HOME/utils/RUN_Server2.sh
#    $ADEMPIERE_HOME/utils/RUN_Server2.sh

    log_end_msg 0
    ;;
  restart|force-reload)
        # nothing to do
    :
    ;;
  stop)
    log_daemon_msg "Stopping Adempiere server" "adempiere"

    #start-stop-daemon --stop --oknodo --quiet --exec $ADEMPIERE_HOME/utils/RUN_Server2.sh
    # Ummm, how do I stop the server?

    log_end_msg 0
    ;;
  status)
    exit 4
    ;;
  *)
    echo "Usage: /etc/init.d/adempiere {start|stop}"
    exit 2
    ;;
esac

exit 0