IDEMPIERE-1900 iDempiere Debian Installer

This commit is contained in:
Carlos Ruiz 2014-04-14 13:06:49 -05:00
parent 2a980dfc58
commit bd8bdb6cc9
32 changed files with 1250 additions and 15 deletions

View File

@ -4,11 +4,11 @@ root.folder.data=data
root.folder.setup=setup root.folder.setup=setup
#linux 64 bits #linux 64 bits
root.linux.gtk.x86_64=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh root.linux.gtk.x86_64=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:idempiereEnvTemplate.properties
root.linux.gtk.x86_64.folder.utils=utils.unix root.linux.gtk.x86_64.folder.utils=utils.unix
root.linux.gtk.x86_64.permissions.755=*.sh,**/*.sh root.linux.gtk.x86_64.permissions.755=*.sh,**/*.sh
#linux #linux
root.linux.gtk.x86=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh root.linux.gtk.x86=file:setup.sh,file:console-setup.sh,file:idempiere-server.sh,file:setup-alt.sh,file:console-setup-alt.sh,file:sign-database-build.sh,file:idempiereEnvTemplate.properties
root.linux.gtk.x86.folder.utils=utils.unix root.linux.gtk.x86.folder.utils=utils.unix
root.linux.gtk.x86.permissions.755=*.sh,**/*.sh root.linux.gtk.x86.permissions.755=*.sh,**/*.sh
#mac #mac

View File

@ -0,0 +1,66 @@
#idempiereEnv.properties Template
#idempiere home
IDEMPIERE_HOME=/opt/idempiere-server
#Java home
JAVA_HOME=
#Java runtime options
IDEMPIERE_JAVA_OPTIONS=-Xms64M -Xmx512M
#Type of database, postgresql|oracle|oracleXE
ADEMPIERE_DB_TYPE=PostgreSQL
ADEMPIERE_DB_EXISTS=N
#Path to database specific sql scripts: postgresql|oracle|oracleXE
ADEMPIERE_DB_PATH=postgresql
#Database server host name
ADEMPIERE_DB_SERVER=localhost
#Database port, oracle[1512], postgresql[5432]
ADEMPIERE_DB_PORT=5432
#Database name
ADEMPIERE_DB_NAME=idempiere
#Database system user password
ADEMPIERE_DB_SYSTEM=
#Database user name
ADEMPIERE_DB_USER=adempiere
#Database user password
ADEMPIERE_DB_PASSWORD=adempiere
#Application server host name
ADEMPIERE_APPS_SERVER=localhost
ADEMPIERE_WEB_ALIAS=localhost
#Application server port
ADEMPIERE_WEB_PORT=8080
ADEMPIERE_SSL_PORT=8443
#Keystore setting
ADEMPIERE_KEYSTORE=/opt/idempiere-server/keystore/myKeystore
ADEMPIERE_KEYSTOREWEBALIAS=adempiere
ADEMPIERE_KEYSTORECODEALIAS=adempiere
ADEMPIERE_KEYSTOREPASS=myPassword
#Certificate details
#Common name, default to host name
ADEMPIERE_CERT_CN=localhost
#Organization, default to the user name
ADEMPIERE_CERT_ORG=iDempiere Bazaar
#Organization Unit, default to 'AdempiereUser'
ADEMPIERE_CERT_ORG_UNIT=iDempiereUser
#town
ADEMPIERE_CERT_LOCATION=myTown
#state
ADEMPIERE_CERT_STATE=CA
#2 character country code
ADEMPIERE_CERT_COUNTRY=US
#Mail server setting
ADEMPIERE_MAIL_SERVER=localhost
ADEMPIERE_ADMIN_EMAIL=
ADEMPIERE_MAIL_USER=
ADEMPIERE_MAIL_PASSWORD=
#ftp server setting
ADEMPIERE_FTP_SERVER=localhost
ADEMPIERE_FTP_PREFIX=my
ADEMPIERE_FTP_USER=anonymous
ADEMPIERE_FTP_PASSWORD=user@host.com

View File

@ -23,20 +23,33 @@ fi
PGPASSWORD=$4 PGPASSWORD=$4
export PGPASSWORD export PGPASSWORD
if [ "x$4" = "x^TryLocalConnection^" ]
then
LOCALPG=true # Allow to run this command with user postgres (just useful running configure as root)
else
LOCALPG=false
fi
echo ------------------------------------- echo -------------------------------------
echo Recreate user and database echo Recreate user and database
echo ------------------------------------- echo -------------------------------------
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $ADEMPIERE_DB_NAME
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2
ADEMPIERE_CREATE_ROLE_SQL="CREATE ROLE $2 SUPERUSER LOGIN PASSWORD '$3'" ADEMPIERE_CREATE_ROLE_SQL="CREATE ROLE $2 SUPERUSER LOGIN PASSWORD '$3'"
if [ $LOCALPG = "true" ]
then
# Assuming that adempiere role already exists (it was created out there)
PGPASSWORD=$3
export PGPASSWORD
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U $2 $ADEMPIERE_DB_NAME
else
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $ADEMPIERE_DB_NAME
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL" psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL"
fi
ADEMPIERE_CREATE_ROLE_SQL= ADEMPIERE_CREATE_ROLE_SQL=
PGPASSWORD=$3 PGPASSWORD=$3
export PGPASSWORD export PGPASSWORD
createdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -E UNICODE -O $2 -U $2 $ADEMPIERE_DB_NAME createdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -E UNICODE -T template0 -O $2 -U $2 $ADEMPIERE_DB_NAME
echo ------------------------------------- echo -------------------------------------
echo Import Adempiere_pg.dmp echo Import Adempiere_pg.dmp

View File

@ -23,20 +23,32 @@ fi
PGPASSWORD=$4 PGPASSWORD=$4
export PGPASSWORD export PGPASSWORD
if [ "x$4" = "x^TryLocalConnection^" ]
then
LOCALPG=true # Allow to run this command with user postgres (just useful running configure as root)
else
LOCALPG=false
fi
echo ------------------------------------- echo -------------------------------------
echo Recreate user and database echo Recreate user and database
echo ------------------------------------- echo -------------------------------------
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $ADEMPIERE_DB_NAME
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2
ADEMPIERE_CREATE_ROLE_SQL="CREATE ROLE $2 SUPERUSER LOGIN PASSWORD '$3'" ADEMPIERE_CREATE_ROLE_SQL="CREATE ROLE $2 SUPERUSER LOGIN PASSWORD '$3'"
if [ $LOCALPG = "true" ]
then
# Assuming that adempiere role already exists (it was created out there)
PGPASSWORD=$3
export PGPASSWORD
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U $2 $ADEMPIERE_DB_NAME
else
dropdb -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $ADEMPIERE_DB_NAME
dropuser -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres $2
psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL" psql -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -U postgres -c "$ADEMPIERE_CREATE_ROLE_SQL"
fi
ADEMPIERE_CREATE_ROLE_SQL= ADEMPIERE_CREATE_ROLE_SQL=
PGPASSWORD=$3 PGPASSWORD=$3
export PGPASSWORD export PGPASSWORD
createdb --template=template0 -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -E UNICODE -O $2 -U $2 $ADEMPIERE_DB_NAME createdb -T template0 -h $ADEMPIERE_DB_SERVER -p $ADEMPIERE_DB_PORT -E UNICODE -O $2 -U $2 $ADEMPIERE_DB_NAME
echo ------------------------------------- echo -------------------------------------
echo Import Adempiere$5.dmp echo Import Adempiere$5.dmp

View File

@ -0,0 +1 @@
/etc/default/idempiere

View File

@ -0,0 +1,12 @@
Package: idempiere
Version: 2.0
Section: web
Priority: extra
Architecture: all
Pre-Depends: openjdk-7-jdk|openjdk-6-jdk, postgresql-9.3|postgresql-9.2|postgresql-9.1, postgresql-contrib, adduser
Suggests: firefox
Installed-Size: 968668
Maintainer: Carlos Ruiz <carg67@gmail.com>
Description: iDempiere ERP
iDempiere Business Suite ERP/CRM/SCM
Homepage: http://www.idempiere.org/

View File

@ -0,0 +1,116 @@
#!/bin/sh
if [ "$1" != "configure" ]
then
exit 0
fi
if [ -z "$2" ]
then
MODE=install
else
MODE=upgrade
fi
if [ -x "/etc/init.d/idempiere" ]; then
update-rc.d idempiere defaults >/dev/null
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d idempiere start || exit 0
else
/etc/init.d/idempiere start || exit 0
fi
fi
echo "Executing Post-install steps..."
if [ "$MODE" = "install" ]
then
if `grep -q ^idempiere: /etc/group`
then
echo ""
else
/usr/sbin/groupadd idempiere
fi
id idempiere > /dev/null 2>&1
status=$?
if test $status -eq 0
then
groups idempiere | grep idempiere > /dev/null
status=$?
if test $status != 0
then
/usr/sbin/usermod -G idempiere idempiere
fi
else
/usr/sbin/useradd -g idempiere -d /opt/idempiere-server -s /bin/bash idempiere
fi
# End MODE=install
fi
if [ "$MODE" = "install" ]
then
# Start Menu icons
mergefile()
{
MENUFILE="$1"
if [ -z "$MENUFILE" ]
then
return
fi
TFILE="$(mktemp)" || TFILE="/tmp/idempiereapplications.tmp"
(sed -n '1,/<\/Menu>/p' "$MENUFILE" ; cat /opt/idempiere-server/utils/unix/idempiere-merge-debian.menu ; sed -n '1,/<\/Menu>/!p' "$MENUFILE" ) > "$TFILE"
cp -f "$TFILE" "$MENUFILE"
rm -f "$TFILE"
}
if [ -f /etc/xdg/menus/gnome-applications.menu ]
then
mergefile /etc/xdg/menus/gnome-applications.menu
fi
if [ -f /etc/xdg/menus/kde-applications.menu ]
then
mergefile /etc/xdg/menus/kde-applications.menu
fi
if [ -f /etc/xdg/menus/applications.menu ]
then
mergefile /etc/xdg/menus/applications.menu
fi
# End MODE=install
fi
/bin/chown -R idempiere:idempiere /opt/idempiere-server
/bin/chown idempiere:idempiere /etc/default/idempiere
/bin/chown idempiere:idempiere /etc/init.d/idempiere
/bin/chown idempiere:idempiere /etc/xdg/menus/idempiere.menu
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-backup.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-gotoonlineforum.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-homepage.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-readdocumentation.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-restore.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-startserver.desktop
/bin/chown idempiere:idempiere /usr/share/applications/idempiere-webclient.desktop
/bin/chown idempiere:idempiere /usr/share/desktop-directories/idempiere.directory
/bin/chown idempiere:idempiere /usr/share/desktop-directories/idempiere-gethelp.directory
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-backup.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-gethelp.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-gotoonlineforum.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-readdocumentation.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-restore.png
/bin/chown idempiere:idempiere /usr/share/pixmaps/idempiere-start.png
CONFIGURATION=/etc/default/idempiere
[ -f "$CONFIGURATION" ] && . "$CONFIGURATION"
if [ "$CONFIGURE_RUN" != "true" ]
then
echo "You must run '/etc/init.d/idempiere configure' as the root user to configure the application."
echo
fi
exit 0

View File

@ -0,0 +1,70 @@
#!/bin/sh
case "$1" in
remove|purge)
;;
*)
exit 0
;;
esac
if [ "$1" = "purge" ] ; then
update-rc.d idempiere remove >/dev/null || exit 0
fi
case "$1" in
purge)
rm -fr /opt/idempiere-server
# rm -fr /etc/default/idempiere
# rm -fr /etc/init.d/idempiere
# rm -fr /etc/xdg/menus/idempiere.menu
rm -fr /usr/share/desktop-directories/idempiere-gethelp.directory
rm -fr /usr/share/desktop-directories/idempiere.directory
rm -fr /usr/share/pixmaps/idempiere-restore.png
rm -fr /usr/share/pixmaps/idempiere.png
rm -fr /usr/share/pixmaps/idempiere-gethelp.png
rm -fr /usr/share/pixmaps/idempiere-gotoonlineforum.png
rm -fr /usr/share/pixmaps/idempiere-backup.png
rm -fr /usr/share/pixmaps/idempiere-start.png
rm -fr /usr/share/pixmaps/idempiere-readdocumentation.png
rm -fr /usr/share/applications/idempiere-gotoonlineforum.desktop
rm -fr /usr/share/applications/idempiere-homepage.desktop
rm -fr /usr/share/applications/idempiere-webclient.desktop
rm -fr /usr/share/applications/idempiere-readdocumentation.desktop
rm -fr /usr/share/applications/idempiere-restore.desktop
rm -fr /usr/share/applications/idempiere-startserver.desktop
rm -fr /usr/share/applications/idempiere-backup.desktop
;;
*)
;;
esac
mergefile()
{
MENUFILE="$1"
if [ -z "$MENUFILE" ]
then
return
fi
TFILE="$(mktemp)" || TFILE="/tmp/idempiereapplications.tmp"
sed -n '/<\!\-- iDempiere \-->/,/<\!\-- End of iDempiere \-->/!p' "$MENUFILE" > "$TFILE"
cp -f "$TFILE" "$MENUFILE"
rm -f "$TFILE"
}
if [ -f /etc/xdg/menus/gnome-applications.menu ]
then
mergefile /etc/xdg/menus/gnome-applications.menu
fi
if [ -f /etc/xdg/menus/kde-applications.menu ]
then
mergefile /etc/xdg/menus/kde-applications.menu
fi
if [ -f /etc/xdg/menus/applications.menu ]
then
mergefile /etc/xdg/menus/applications.menu
fi
exit 0

View File

@ -0,0 +1,48 @@
#!/bin/sh
if [ "$1" != "install" -o -n "$2" ]
then
exit 0
fi
# User must be root
if [ $(id -u) != "0" ]
then
echo "You must be the root to install the software" >&2
exit 1
fi
# IDEMPIERE_HOME must be unset
if `env | grep -q IDEMPIERE_HOME`
then
unset IDEMPIERE_HOME
fi
# Check for sufficient diskspace
if [ -d /opt/idempiere-server ]
then
diskspace=`df -k /opt/idempiere-server | grep % | tr -s " " | cut -d" " -f4 | tail -1`
diskspace=`expr $diskspace / 1024`
if [ $diskspace -lt 1024 ]
then
echo "You have insufficient diskspace in the destination directory (/opt/idempiere-server)
to install idempiere The installation requires at
least 1 GB free on this disk."
exit 1
fi
else
diskspace=`df -k /usr/lib | grep % | tr -s " " | cut -d" " -f4 | tail -1`
diskspace=`expr $diskspace / 1024`
if [ $diskspace -lt 1024 ]
then
echo "You have insufficient diskspace in the destination directory (/usr/lib) to
install idempiere. The installation requires at
least 1 GB free on this disk."
exit 1
fi
fi
# Don't fail, even on sysctl errors
exit 0

View File

@ -0,0 +1,17 @@
#!/bin/sh
if [ "$1" != "remove" ]
then
exit 0
fi
if [ -x "/etc/init.d/idempiere" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d idempiere stop || exit 0
else
/etc/init.d/idempiere stop || exit 0
fi
fi
exit 0

View File

@ -0,0 +1,3 @@
#
# Please run "/etc/init.d/idempiere configure" to configure iDempiere.
#

View File

@ -0,0 +1,736 @@
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: idempiere
# Required-Start: postgresql
# Required-Stop: postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: iDempiere server
# Description: Provides iDempiere ERP-CRM Server startup and shutdown script. Requires PostgreSQL server.
# FileTarget: /etc/init.d/idempiere
# FileOwner: root.root
# FilePerms: 0755
#
# chkconfig: 2345 97 06
### END INIT INFO
# processname: idempiere
# Red Hat or SuSE config: /etc/sysconfig/idempiere
# Debian or Ubuntu config: /etc/default/idempiere
# Source function library
if [ -f /lib/lsb/init-functions ]
then
. /lib/lsb/init-functions
elif [ -f /etc/init.d/functions ]
then
. /etc/init.d/functions
fi
# Set path if path not set (if called from /etc/rc)
case $PATH in
"") PATH=/bin:/usr/bin:/sbin:/etc
export PATH ;;
esac
# initialization
# adjust these variables to your environment
IDEMPIERE_USER=idempiere
IDEMPIERE_HOME=/opt/idempiere-server
JAVA_HOME=`ls -r /usr/lib/jvm/java-[67]-openjdk*/bin/javac | head -1`
JAVA_HOME=`dirname $JAVA_HOME`
JAVA_HOME=`dirname $JAVA_HOME`
SU=su
export IDEMPIERE_HOME
if [ $(id -u) != "0" ]
then
echo "You must be root to run the configure script. Login as root and then run the configure script."
exit 1
fi
RETVAL=0
IDEMPIERESTATUS=
MAXSECONDS=120 # max wait 2 minutes
SLEEPSECONDS=2
MAXITERATIONS=`expr $MAXSECONDS / $SLEEPSECONDS`
CONFIG_NAME=idempiere
CONFIGURATION="/etc/sysconfig/$CONFIG_NAME"
if [ -f /etc/redhat-release ]
then
. /etc/init.d/functions
init_status()
{
return 0
}
exit_status()
{
exit $?
}
success_status()
{
success
echo
}
failure_status()
{
failure $?
echo
}
elif [ -f /etc/SuSE-release ]
then
. /etc/rc.status
init_status()
{
rc_reset
}
success_status()
{
echo "OK"
return 0
}
failure_status()
{
echo "Failed"
return 1
}
exit_status()
{
exit $?
}
else
if [ -d /etc/default ]
then
CONFIGURATION="/etc/default/$CONFIG_NAME"
fi
init_status()
{
return 0
}
success_status()
{
echo "OK"
return 0
}
failure_status()
{
echo "Failed"
return 0
}
exit_status()
{
exit $?
}
fi
# Source configuration
[ -f "$CONFIGURATION" ] && . "$CONFIGURATION"
init_status
#
# if_fail()
#
# Evaluates return codes. If 0, prints "OK", if 1, prints "Failed"
# and exits. If 2, status is "already done" and nothing is printed.
# The rest of the functions in here all honor this convention.
#
if_fail()
{
RC="$1"
REASON="$2"
if [ "$RC" = "0" ]
then
return
elif [ "$RC" = "2" ]
then
return
fi
failure_status "${REASON}"
exit 1
}
#
# write_sysconfig()
#
# Writes the system configuration
#
write_sysconfig()
{
cat >"$CONFIGURATION" <<EOF
#This is a configuration file for automatic starting of the iDempiere
#Server at system startup. It is generated by running
#'/etc/init.d/idempiere configure'.Please use that method to modify this
#file
# RUN_AT_STARTUP:'true' means to load the Server at system boot.
RUN_AT_STARTUP=${RUN_AT_STARTUP:-false}
# Configuration : Check whether configure has been done or not
CONFIGURE_RUN=${CONFIGURE_RUN}
EOF
if [ $? != 0 ]
then
return 1
fi
return 0
}
# configure_perform()
# Create idempiereEnv.properties
# RUN_silentsetup.sh
# Import database
configure_perform()
{
cp ${IDEMPIERE_HOME}/idempiereEnvTemplate.properties ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^IDEMPIERE_HOME=.*:IDEMPIERE_HOME=${IDEMPIERE_HOME}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^JAVA_HOME=.*:JAVA_HOME=${JAVA_HOME}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_DB_PASSWORD=.*:ADEMPIERE_DB_PASSWORD=${ADEMPIERE_DB_PASSWORD}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_DB_SYSTEM=.*:ADEMPIERE_DB_SYSTEM=${ADEMPIERE_DB_SYSTEM}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_WEB_PORT=.*:ADEMPIERE_WEB_PORT=${ADEMPIERE_WEB_PORT}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_SSL_PORT=.*:ADEMPIERE_SSL_PORT=${ADEMPIERE_SSL_PORT}:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_APPS_SERVER=.*:ADEMPIERE_APPS_SERVER=0.0.0.0:" ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s:^ADEMPIERE_KEYSTORE=.*:ADEMPIERE_KEYSTORE=${IDEMPIERE_HOME}/keystore/myKeystore:" ${IDEMPIERE_HOME}/idempiereEnv.properties
chown idempiere:idempiere ${IDEMPIERE_HOME}/idempiereEnv.properties
chmod 600 ${IDEMPIERE_HOME}/idempiereEnv.properties
sed -i "s/:8080/:${ADEMPIERE_WEB_PORT}/g" /usr/share/applications/idempiere-homepage.desktop
sed -i "s/:8443/:${ADEMPIERE_SSL_PORT}/g" /usr/share/applications/idempiere-webclient.desktop
if [ -f ${IDEMPIERE_HOME}/console-setup.sh ]
then
echo -n "Deploying iDempiere ERP server..."
$SU ${IDEMPIERE_USER} -c "cd ${IDEMPIERE_HOME}; ./console-setup.sh" <<!
!
echo "Done"
fi
grep ${ADEMPIERE_WEB_PORT} ${IDEMPIERE_HOME}/plugins/org.adempiere.tomcat.config_2.0.0/META-INF/tomcat/server.xml > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "Error deploying iDempiere, please verify and try again"
exit 1
fi
if [ "x${ADEMPIERE_DB_SYSTEM}" = "x^TryLocalConnection^" ]
then
# recreate idempiere user from here as the RUN_ImportIdempiere requires it
$SU postgres -c "dropdb -U postgres idempiere" # > /dev/null 2>&1
$SU postgres -c "dropuser -U postgres idempiere" # > /dev/null 2>&1
$SU postgres -c "psql -U postgres -c \"CREATE ROLE adempiere SUPERUSER LOGIN PASSWORD '${ADEMPIERE_DB_PASSWORD}'\"" # > /dev/null 2>&1
fi
if [ -f ${IDEMPIERE_HOME}/utils/RUN_ImportIdempiere.sh ]
then
echo -n "Importing seed database..."
$SU ${IDEMPIERE_USER} -c "cd ${IDEMPIERE_HOME}/utils; ( echo "" | ./RUN_ImportIdempiere.sh )" # > /dev/null 2>&1
echo "Done"
fi
$SU ${IDEMPIERE_USER} -c "export PGPASSWORD=${ADEMPIERE_DB_PASSWORD}; psql -d idempiere -U adempiere -h localhost -p 5432 -c ''" > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "Cannot connect to idempiere database, please verify and try again"
exit 1
fi
$SU ${IDEMPIERE_USER} -c "export PGPASSWORD=${ADEMPIERE_DB_PASSWORD}; psql -d idempiere -U adempiere -h localhost -p 5432 -c 'select count(*) from ad_system' 2>&1 | grep '1$'" > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "Database not imported correctly, please verify and try again"
exit 1
fi
chmod 700 ${IDEMPIERE_HOME}/utils/myEnvironment.*
echo "Installation Completed Successfully."
return 0
}
checkportused()
{
port=`netstat -n --tcp --listen | grep :$1 | awk '{print $4}' | cut -d':' -f2`
if [ "$port" = "$1" ]
then
return 0 # Used
else
return 1 # Not Used
fi
}
#
#configure_ask()
#
# Ask configuration questions,setting the variables.
#
configure_ask()
{
cat <<EOF
iDempiere ERP Server Configuration
-------------------------------------------------
This will configure on-boot properties of iDempiere ERP Server.
The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press <Enter> to accept the defaults.
Ctrl-C will abort.
EOF
# TODO: ask for certificate data (or integrate with openssl certificate)
# TODO: ask for mail server settings
# TODO: ask for postgres port (and perhaps machine if it's remote)
# Check not configurable tomcat ports (i.e. 8005, 8009)
for TOMCATPORT in 8005 8009
do
if checkportused "$TOMCATPORT"
then
echo Port $TOMCATPORT is required by iDempiere ERP server and it appears to be in use by another application.\
Please fix the problem and try again.
exit 1
fi
done
#get the http port value
while :
do
while [ 1 ]
do
echo -n Specify the HTTP port that will be used for iDempiere server [8080]:
read LINE
if [ -z $LINE ]
then
LINE=8080
fi
if checkportused "$LINE"
then
echo Port $port appears to be in use by another application.\
Please specify a different port.
else
break;
fi
done
case "$LINE" in
"")
break
;;
*[^0-9]*)
echo "Invalid http port: $LINE"
;;
*)
ADEMPIERE_WEB_PORT=$LINE
break
;;
esac
done
#get the https port value
while :
do
while [ 1 ]
do
echo -n Specify the HTTPS port that will be used for iDempiere server [8443]:
read LINE
if [ -z $LINE ]
then
LINE=8443
fi
if checkportused "$LINE"
then
echo Port $port appears to be in use by another application.\
Please specify a different port.
else
break;
fi
done
case "$LINE" in
"")
break
;;
*[^0-9]*)
echo "Invalid https port: $LINE"
;;
*)
ADEMPIERE_SSL_PORT=$LINE
break
;;
esac
done
#get the idempiere database password
while :
do
echo -n "Specify a password to be used for adempiere database account:"
while [ 1 ]
do
stty -echo > /dev/null 2>&1
temp=`echo $IFS`
export IFS="\n"
while [ 1 ]
do
read LINE
while [ -z "$LINE" ]
do
echo
echo -n "Password can't be null. Enter password:"
read LINE
done
result=`expr index "$LINE" [\'\"]`
if [ $result != 0 ];
then
echo
echo -n "The password you entered contains invalid characters. Enter password:"
else
break
fi
done
echo
echo -n "Confirm the password:"
read LINE1
echo
if [ "$LINE" != "$LINE1" ];
then
echo
echo -n "Passwords do not match. Enter the password:"
else
break
fi
done
stty echo > /dev/null 2>&1
ADEMPIERE_DB_PASSWORD=$LINE
export IFS=$temp
break;
done
#get the postgres database password
while :
do
echo -n "Specify the password of the user postgres on postgres database
(if empty then local connection will be tried):"
while [ 1 ]
do
stty -echo > /dev/null 2>&1
temp=`echo $IFS`
export IFS="\n"
while [ 1 ]
do
read LINE
if [ -z "$LINE" ]
then
break
fi
result=`expr index "$LINE" [\'\"]`
if [ $result != 0 ];
then
echo
echo -n "The password you entered contains invalid characters. Enter password:"
else
break
fi
done
echo
if [ -z "$LINE" ]
then
# Empty postgres password verify connection with local postgres user
$SU postgres -c "psql -U postgres -c ''"
if [ $? -eq 0 ]
then
break
fi
echo -n "Could not connect locally with user postgres.
NOTE: You can verify pg_hba.conf to check if this line is enabled
local all postgres ident
Enter postgres password:"
else
PGPASSWORD=$LINE
export PGPASSWORD
psql -U postgres -d template1 -h localhost -p 5432 -c ''
if [ $? -eq 0 ]
then
break
fi
echo -n "Could not connect with user postgres to database template with such password.
NOTE: You can check the file pg_hba.conf to validate that connection is allowed,
or check that postgresql server allows tcp/ip connections on port 5432
or check that user postgres database password is correctly set.
Enter postgres password:"
fi
done
stty echo > /dev/null 2>&1
if [ -z "$LINE" ]
then
LINE="^TryLocalConnection^"
fi
ADEMPIERE_DB_SYSTEM=$LINE
export IFS=$temp
break;
done
while :
do
if [ "${RUN_AT_STARTUP}" = "true" ]
then
CUR=y
else
CUR=n
fi
echo
echo -n "Do you want iDempiere ERP Server to be started on boot (y/n) [y]:"
read LINE
if [ -z $LINE ]
then
RUN_AT_STARTUP=true
fi
echo
case "$LINE" in
"")
break
;;
y|Y)
RUN_AT_STARTUP=true
break
;;
n|N)
RUN_AT_STARTUP=false
break
;;
*)
echo "Invalid response: $LINE " >&2
break
esac
done
}
getidempierestatus() {
IDEMPIERESTATUSSTRING=$(ps ax | grep -v grep | grep ${IDEMPIERE_HOME})
echo $IDEMPIERESTATUSSTRING | grep -q ${IDEMPIERE_HOME}
IDEMPIERESTATUS=$?
}
configure()
{
if [ "${CONFIGURE_RUN}" = "true" ]
then
echo "iDempiere is already configured"
exit 1
fi
configure_ask
configure_perform
CONFIGURE_RUN=true
write_sysconfig
echo To access the iDempiere Server Home Page, start the server with '/etc/init.d/idempiere start'
echo and then go to \"http://127.0.0.1:${ADEMPIERE_WEB_PORT}\"
}
start () {
if [ "${CONFIGURE_RUN}" != "true" ]
then
echo "iDempiere is not configured. You must run
'/etc/init.d/idempiere configure' as the root user to configure the server."
exit 0
fi
getidempierestatus
if [ $IDEMPIERESTATUS -eq 0 ] ; then
echo "iDempiere is already running"
return 1
fi
echo -n "Starting iDempiere ERP: "
export LOGFILE=$IDEMPIERE_HOME/log/idempiere_`date +%Y%m%d%H%M%S`.log
$SU ${IDEMPIERE_USER} -c "mkdir -p $IDEMPIERE_HOME/log"
$SU ${IDEMPIERE_USER} -c "cd $IDEMPIERE_HOME;$IDEMPIERE_HOME/idempiere-server.sh &> $LOGFILE &"
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
# wait for server to be confirmed as started in logfile
STATUSTEST=0
ITERATIONS=0
while [ $STATUSTEST -eq 0 ] ; do
sleep $SLEEPSECONDS
tail -n 9 $LOGFILE | grep -q '.*WebUIServlet.*started successfully.*' && STATUSTEST=1
echo -n "."
ITERATIONS=`expr $ITERATIONS + 1`
if [ $ITERATIONS -gt $MAXITERATIONS ]
then
break
fi
done
if [ $STATUSTEST -eq 0 ]
then
log_warning_msg "Service hasn't started within the timeout allowed, please review file $LOGFILE to see the status of the service"
else
log_success_msg "Service started"
fi
echo
else
log_failure_msg "Service not started"
echo
fi
RETVAL=$?
return $RETVAL
}
stop () {
if [ "${CONFIGURE_RUN}" != "true" ]
then
echo "iDempiere is not configured. You must run
'/etc/init.d/idempiere configure' as the root user to configure the server."
exit 0
fi
getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then
echo "iDempiere is already stopped"
return 1
fi
echo -n "Stopping iDempiere ERP: "
cd $IDEMPIERE_HOME/utils
log_warning_msg "Trying direct kill with signal -15"
# try direct kill with signal 15, then signal 9
kill -15 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
sleep 5
getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then
log_success_msg "Service stopped with kill -15"
else
echo "Trying direct kill with signal -9"
kill -9 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " " | sort -u`
sleep 5
getidempierestatus
if [ $IDEMPIERESTATUS -ne 0 ] ; then
log_success_msg "Service stopped with kill -9"
else
log_warning_msg "Service hasn't stopped"
fi
fi
return $RETVAL
}
restart () {
stop
sleep $SLEEPSECONDS
start
}
condrestart () {
getidempierestatus
if [ $IDEMPIERESTATUS -eq 0 ] ; then
restart
fi
}
dostatus () {
getidempierestatus
if [ $IDEMPIERESTATUS -eq 0 ] ; then
echo
echo "iDempiere is running:"
ps ax | grep -v grep | grep ${IDEMPIERE_HOME} | sed 's/^[[:space:]]*\([[:digit:]]*\).*:[[:digit:]][[:digit:]][[:space:]]\(.*\)/\1 \2/'
echo
else
echo "iDempiere is stopped"
fi
}
case "$1" in
start)
if test -f "$CONFIGURATION"
then
if test "${RUN_AT_STARTUP}" != "true"
then
exit 0
fi
else
echo "iDempiere is not configured. You must run
'/etc/init.d/idempiere configure' as the root user to configure the server."
exit 0
fi
start
;;
configure)
configure
;;
stop)
stop
;;
restart|reload|force-reload)
restart
;;
condrestart)
condrestart
;;
status)
dostatus
;;
enable)
if test -f "$CONFIGURATION"
then
RUN_AT_STARTUP=true
write_sysconfig
else
echo "iDempiere is not configured. You must run
'/etc/init.d/idempiere configure' as the root user to configure the server."
exit 0
fi
;;
disable)
if test -f "$CONFIGURATION"
then
RUN_AT_STARTUP=false
write_sysconfig
else
echo "iDempiere is not configured. You must run
'/etc/init.d/idempiere configure' as the root user to configure the server."
exit 0
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|force-reload|configure|status|enable|disable}"
exit 1
esac
exit 0

View File

@ -0,0 +1,23 @@
<!-- iDempiere ERP -->
<Menu>
<Name>iDempiere ERP</Name>
<Directory>idempiere.directory</Directory>
<NotDeleted/>
<Include>
<Filename>idempiere-startserver.desktop</Filename>
<Filename>idempiere-homepage.desktop</Filename>
<Filename>idempiere-webclient.desktop</Filename>
<Filename>idempiere-backup.desktop</Filename>
<Filename>idempiere-restore.desktop</Filename>
</Include>
<Menu>
<Name>Get Help</Name>
<Directory>idempiere-gethelp.directory</Directory>
<NotDeleted/>
<Include>
<Filename>idempiere-gotoonlineforum.desktop</Filename>
<Filename>idempiere-readdocumentation.desktop</Filename>
</Include>
</Menu>
</Menu>
<!-- End of iDempiere -->

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Exec=gksudo "su -c idempiere '/opt/idempiere-server/utils/RUN_DBExport.sh'"
Terminal=true
MultipleArgs=true
Type=Application
Categories=Applications;
Icon=idempiere-backup.png
Encoding=UTF-8
Name=Backup Database
Name[es]=Copia de Seguridad de Base de Datos

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Terminal=false
MultipleArgs=true
Type=Link
URL=https://groups.google.com/forum/?fromgroups#!forum/idempiere
Categories=Applications;
Icon=idempiere-gotoonlineforum.png
Encoding=UTF-8
Name=Go To Online Forum
Name[es]=Ir a Foro en Línea

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Terminal=false
MultipleArgs=true
Type=Link
URL=http://localhost:8080
Categories=Applications;
Icon=idempiere.png
Encoding=UTF-8
Name=iDempiere Homepage
Name[es]=Página Principal iDempiere

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Terminal=false
MultipleArgs=true
Type=Link
URL=http://wiki.idempiere.org
Categories=Applications;
Icon=idempiere-readdocumentation.png
Encoding=UTF-8
Name=Read Documentation
Name[es]=Leer Documentación

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Exec=gksudo "su -c idempiere '/opt/idempiere-server/utils/RUN_DBRestore.sh'"
Terminal=true
MultipleArgs=true
Type=Application
Categories=Applications;
Icon=idempiere-restore.png
Encoding=UTF-8
Name=Restore Database
Name[es]=Restaurar Base de Datos

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Exec=gksudo "su -c idempiere '/opt/idempiere-server/idempiere-server.sh'"
Terminal=true
MultipleArgs=true
Type=Application
Categories=Applications;
Icon=idempiere-start.png
Encoding=UTF-8
Name=Start Server
Name[es]=Iniciar Servidor

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Terminal=false
MultipleArgs=true
Type=Link
URL=https://localhost:8443/webui
Categories=Applications;
Icon=idempiere-gotoonlineforum.png
Encoding=UTF-8
Name=iDempiere Web Client
Name[es]=Cliente Web iDempiere

View File

@ -0,0 +1,6 @@
[Desktop Entry]
Icon=idempiere-gethelp.png
Type=Directory
Encoding=UTF-8
Name=Get Help
Name[es]=Obtener Ayuda

View File

@ -0,0 +1,7 @@
[Desktop Entry]
Icon=idempiere.png
Type=Directory
Encoding=UTF-8
Name=iDempiere ERP
Name[es]=iDempiere ERP

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1,23 @@
VERSION=dev
TIMESTAMP=`date +%Y%m%d`
TMP=/tmp
cd `dirname $0`/../../..
IDEMPIERE_HOME=`pwd`
RWD=$IDEMPIERE_HOME/idempiere-server/utils/unix
PACKAGE=`ls -d $IDEMPIERE_HOME`
PACKAGE=`basename $PACKAGE`
PACKFILE=$IDEMPIERE_HOME/../${PACKAGE}_${VERSION}_${TIMESTAMP}.deb
find $RWD/../.. -name "*.sh" -exec chmod +x {} \;
chmod +x $RWD/DebianInstaller/etc/init.d/idempiere
rm -f $TMP/debian-binary $TMP/control.tar.gz $TMP/data.tar.gz $TMP/control.tar $TMP/data.tar $PACKFILE
echo 2.0 > $TMP/debian-binary
tar cvf $TMP/control.tar -C $RWD/DebianInstaller/DEBIAN .
gzip -v -9 $TMP/control.tar
tar cvf $TMP/data.tar -C $RWD/DebianInstaller/ ./usr
tar rvf $TMP/data.tar --exclude='idempiere.gtk.linux.x86_64/idempiere-server/utils/unix/createDEBpackage.sh' --exclude='idempiere.gtk.linux.x86_64/idempiere-server/utils/unix/DebianInstaller' --transform 's:^idempiere.gtk.linux.x86_64/idempiere-server:./opt/idempiere-server:' -C $RWD/../../../.. $PACKAGE > /dev/null
tar rvf $TMP/data.tar -C $RWD/DebianInstaller/ ./etc
gzip -v -9 $TMP/data.tar
cd $TMP
ar q $PACKFILE debian-binary control.tar.gz data.tar.gz
rm debian-binary control.tar.gz data.tar.gz
echo "Created $PACKFILE"

View File

@ -0,0 +1,7 @@
<!-- iDempiere -->
<Menu>
<Name>iDempiere</Name>
<MergeFile>idempiere.menu</MergeFile>
</Menu>
<!-- End of iDempiere -->

View File

@ -136,10 +136,15 @@ public class ConfigPostgreSQL implements IDatabaseConfig
if (!pass) { if (!pass) {
if (isDBExists) { if (isDBExists) {
log.warning(error); log.warning(error);
} else {
if ("^TryLocalConnection^".equals(systemPassword)) {
// Debian installer uses postgres socket domain connection
log.warning(error);
} else { } else {
return error; return error;
} }
} }
}
if (log.isLoggable(Level.INFO)) log.info("OK: System Connection = " + urlSystem); if (log.isLoggable(Level.INFO)) log.info("OK: System Connection = " + urlSystem);
data.setProperty(ConfigurationData.ADEMPIERE_DB_SYSTEM, systemPassword); data.setProperty(ConfigurationData.ADEMPIERE_DB_SYSTEM, systemPassword);