cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in alfresco standalone deployment Receiver in LINUX

winsenthil
Champ in-the-making
Champ in-the-making
Hi…
I am using alfresco community edition 3.3g…
LINUX environment.
I had installed alfresco 3.3g and both tomcat and virtual tomcat server are started up properly…
But there is a problem in Alfresco Standalone Deployment Receiver start up.. Its not starting up,,
I checked whether my JAVA_HOME environmental variable are correct and they are properly setted.. And still I cant start my DR? whats the reason? Did I missed anything??

My JAVA_HOME is: /usr/java/jdk1.6.0_11

I had created a script in etc/init.d/ with the name alfresco-deployer.sh for service startup during boot.. and the script as follows:

#!/bin/bash
# This is the init script for starting up the
#  Jakarta Alfresco Deployer server
#
# chkconfig: 345 91 10
# description: Starts and stops the Alfresco Deployer daemon.
#

# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

alfhome=/usr/share/alfresco-3.3g
startup=$alfhome/Deployment/deploy_start.sh
shutdown=$alfhome/Deployment/deploy_stop.sh
export JAVA_HOME=/usr/java/jdk1.6.0_11

start(){
echo -n $"Starting Alfresco Deployer service: "
#daemon -c
runuser -s /bin/bash - root -c $startup
RETVAL=$?
echo
}

stop(){
action $"Stopping Alfresco Deployer service: "
runuser -s /bin/bash - root -c $shutdown
RETVAL=$?
echo
}

restart(){
  stop
  start
}

status(){
numproc=`ps -ef | grep alfresco.deployment | grep -v "grep alfresco.deployment" | wc -l`
if [ $numproc -gt 0 ]; then
echo "Alfresco Deployer is running…"
else
echo "Alfresco Deployer is stopped…"
fi
}


# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
      # This doesn't work 😉
status
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac

exit 0

And my deploy_start.sh file in /usr/share/alfresco-3.3g/Deployment will be as follows:

#!/bin/sh

# Make sure prerequisite environment variables are set
if [ -z "$JAVA_HOME" ]; then
    JAVA_PATH=`which java 2>/dev/null`
    if [ "x$JAVA_PATH" != "x" ]; then
      JAVA_LOCATION=`dirname $JAVA_PATH 2>/dev/null`
      JAVA_HOME=`dirname $JAVA_LOCATION 2>/dev/null`
    fi
fi

if [ -z "$JAVA_HOME" ]; then
    echo "The JAVA_HOME  environment variable is not defined"
    exit 1
fi

#
# Set the JAVA_EXT_DIR to point to the java extensions folder.
# this will be needed to pick up the cryptography libraries
#
if [ -e "$JAVA_HOME/lib/ext" ]
then
    JAVA_EXT_DIR=$JAVA_HOME/lib/ext
fi

if [ -e "$JAVA_HOME/jre/lib/ext" ]
then
    JAVA_EXT_DIR=$JAVA_HOME/jre/lib/ext
fi

if [ -z "$JAVA_EXT_DIR" ];
then
   JAVA_EXT_DIR=/usr/lib/jvm/jre/lib/ext
fi


# Set RMI_LISTEN_HOSTNAME to the hostname you wish the deployment server to listen on.
# See http://www.springframework.org/docs/api/org/springframework/remoting/rmi/RmiServiceExporter.html
# for more details.
RMI_LISTEN_HOSTNAME=""
echo .
echo ====================================
echo = Start Alfresco Deployment Server =
echo ====================================
echo .

if [ -z "$RMI_LISTEN_HOSTNAME" ] ; then
    nohup $JAVA_HOME/bin/java -server -classpath . -Djava.ext.dirs=.:$JAVA_EXT_DIR org.alfresco.deployment.Main application-context.xml &
else
    nohup $JAVA_HOME/bin/java -server -classpath . -Djava.ext.dirs=.:$JAVA_EXT_DIR -Djava.rmi.server.hostname=$RMI_LISTEN_HOSTNAME org.alfresco.deployment.Main application-context.xml &
fi


Did I missed anything or do I need to have any change in the above sh files to have a successful deployment server startup??
Kindly reply…
5 REPLIES 5

mrogers
Star Contributor
Star Contributor
What path is "." when running from .etc/init.d :wink:

You are going to have to do some debugging to see why its not running. 

Do you have anything in your deployment.log file?

abhashree
Champ in-the-making
Champ in-the-making
hi
Have you installed DR properly…Is it necessary to write a start up script for DR..I hadnt written any start up script but my DR was running.pls check all the procedure of installation properly..R u using  Alfresco-DeploymentCommunity-3.3-Linux-x86-Install or something else…

winsenthil
Champ in-the-making
Champ in-the-making
Hi…
I dont have a deployment.log file. :shock:
I got the same problem in windows and after setting the JAVA_HOME environmental variable, DR is successfully started and the log files are properly created after DR startup.

The same problem is in LINUX now.. I checked my environmental variables and i saw JAVA_HOME are properly setted…
Anything I had left?? I removed my sh file in /etc/init.d and I tried to execute the shell script directly from the terminal like: /usr/share/alfresco-3.3g/Deployment/deploy_start.sh, I am getting something like:
.
====================================
= Start Alfresco Deployment Server =
====================================
.
nohup: appending output to `nohup.out'

is anything wrong with RMI_LISTEN_HOSTNAME in deployment_start.sh file….

# Set RMI_LISTEN_HOSTNAME to the hostname you wish the deployment server to listen on.
# See http://www.springframework.org/docs/api/org/springframework/remoting/rmi/RmiServiceExporter.html
# for more details.
RMI_LISTEN_HOSTNAME=""
echo .
echo ====================================
echo = Start Alfresco Deployment Server =
echo ====================================
echo .

if [ -z "$RMI_LISTEN_HOSTNAME" ] ; then
    nohup $JAVA_HOME/bin/java -server -classpath . -Djava.ext.dirs=.:$JAVA_EXT_DIR org.alfresco.deployment.Main application-context.xml &
else
    nohup $JAVA_HOME/bin/java -server -classpath . -Djava.ext.dirs=.:$JAVA_EXT_DIR -Djava.rmi.server.hostname=$RMI_LISTEN_HOSTNAME org.alfresco.deployment.Main application-context.xml &
fi

abhashree
Champ in-the-making
Champ in-the-making
hi
where u want to see deployment log files…when i started DR i also got the same thing..the log files are created in logs present in the Deployment folder..
u can check logs there…

winsenthil
Champ in-the-making
Champ in-the-making
Thanks.
As you said its with the path problem running from .etc/init.d.
In order to execute this script from anywhere (like /etc/init.d as a service), used cd $(dirname "$0").
now its working fine…