cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 1.3 on Debian: how to start it at boot time?

pascalsartorett
Champ in-the-making
Champ in-the-making
Hello,

I have set-up Alfresco 1.3 on a Linux (Debian Sarge) machine, everything works fine except one thing: I can start Alfresco from the command-line ("alfresco.sh start"), but I can't configure it to automatically start when the machine boots (using scripts in /etc/init.d): when accessing alfresco's home page from a browser, I get a log-in screen, but the standard account "admin/admin" is not accepted. In contrast, when Alfresco is started from the command-line, I directly go to the "guest" screen, from which I can then log in as "admin/admin".

Any idea of what prevents Alfresco to be started at boot time?

Thanks for any help

Pascal

PS: I have also set JAVA_HOME explicitely in "alfresco.sh".
10 REPLIES 10

zorgh
Champ in-the-making
Champ in-the-making
Hi

Did you find a solution ?

pascalsartorett
Champ in-the-making
Champ in-the-making
> Did you find a solution ?

No… What would really help me : understand the Alfresco logic which makes that the log-in screen is displayed, but no log-in is successful. It looks like alfresco can connect to the database (else alfresco doesn't start at all), but the database is seen as empty…

By the way, which log file(s) should I look for? I found an "alfresco.log" in alfresco's root directory, but are there other logs? Note: I use alfresco's integrated Tomcat.

Pascal

marcus
Champ in-the-making
Champ in-the-making
I've come across the same problem on CentOS.

When manually starting alfresco from the command line it'd work fine, but when stuck in init.d it wouldn't. After pulling my hair out, it turned out that when started from the command line I was going to my alfresco install directory before running `./alfresco.sh start`, whereas running from the init.d script it was executing from that directory and not allowing me to login (additionally, there was no 'error' in the log at all.

Is there a reason (some path reference perhaps?) that alfresco needs to be started from the install directory instead of any arbitrary location?

pascalsartorett
Champ in-the-making
Champ in-the-making
Thanks, this was in fact the cause of the problem: the "alfresco.sh" script needs to first set the right working directory…

zorgh
Champ in-the-making
Champ in-the-making
I have exactly the same problem (debian sarge) :

2 scripts at boot time :

xvfb.sh


#!/bin/sh
#
XVFB=/usr/X11R6/bin/Xvfb
PIDFILE=/var/run/xvfb.pid

test -x $XVFB || exit 0

case "$1" in
  start)
    echo -n "Starting virtual X frame buffer: Xvfb"
    start-stop-daemon –start –quiet  –pidfile $PIDFILE –make-pidfile –background \
    –exec $XVFB – -fp /usr/X11R6/lib/X11/fonts/misc :1 -screen 0 800x600x16 -fbdir /usr/src &
    echo "."
    ;;
  stop)
    echo -n "Stopping virtual X frame buffer: Xvfb"
    start-stop-daemon –stop –quiet –pidfile $PIDFILE
    echo "."
    ;;
  restart)
    $0 stop
    $0 start
    ;;
*)
echo "Usage: /etc/init.d/xvfb.sh {start|stop|restart}"
exit 1
esac

exit 0
with update-rc.d xvfb.sh defaults 95

and sofficed.sh


#!/bin/sh
#
OOo=/opt/openoffice.org2.0/program/soffice
PIDFILE=/var/run/soffice.pid
# Set any default JVM values
export JAVA_HOME=/opt/jdk1.5.0_07/
export JAVA_OPTS="-Xms256m -Xmx1024m -server -XX:CompileCommand=exclude,org/apache/lucene/index/IndexReader\$1,doBody"

case "$1" in
  start)
    DISPLAY=:1
    echo -n "Starting OpenOffice service…"
    start-stop-daemon –start –quiet  –pidfile $PIDFILE –make-pidfile  –background \
    –exec $OOo – "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager -nologo -headless -display :1" &
    echo "Done."
    ;;
  stop)
    echo -n "Stopping Openoffice service…"
    killall soffice.bin
    echo "."
    ;;
  restart)
    $0 stop
    $0 start
    ;;
*)
echo "Usage: /etc/init.d/sofficed.sh {start|stop|restart}"
exit 1
esac

exit 0
with update-rc.d sofficed.sh defaults 99

When manually starting xvfb.sh and sofficed.sh from the command line it's ok.

After reboot,  xvfb start up but openoffice fails to start.

I don't understand.

Thx

zorgh
Champ in-the-making
Champ in-the-making
sofficed.sh has been changed.
I'm using the following script and now it works.


#!/bin/sh
#

start() {
        echo -n "Starting OpenOffic service…"
        su - user -c "/opt/openoffice.org2.0/program/soffice -headless \"-accept=socket,host=localhost,port=8100;urp;\" -display :1 &"
        echo " –> done."
        }

stop() {

        echo -n "Stopping OpenOffice service…"
        killall soffice.bin
        echo " –> done."
        }

status() {
        echo "—-";
        }

case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                start
                ;;
        status)
                status
                ;;
        *)
                echo $"Usage: $0 {start|stop|restart|status}"
                exit 1
esac
exit 0

I added following lines in .bashrc (user) :

export DISPLAY=:1

steve
Champ in-the-making
Champ in-the-making
Hi,

The problem is probably because you have started Alfresco from two different locations, and have not hardcoded the 'alf_data' location so it is created locally to the start location.

i.e. you initially started if from location1/alfresco therefore the alf_data dir will be location1/alfresco/alf_data.
Starting it from another location (anotherlocation/) will mean that it will look for an alf_data dir in aontherlocation/alf_data.

Alfresco uses the lucene indexes stored in alf_data to perform username lookups, and because you initially started alfresco in location1/alfresco the alf_data in that location will contain the lucene indexes with the username information. Thus, when you start alfresco from anotherlocation it will not find the lucene indexes containing the username info and you won't be able to log in.

You can use the extension system to override the repository.properties file to hard code the location of the alf_data directory…

There are three files that are used to configure the repository properties (after being renamed by taking the '.sample' off the end):

custom-db-and-data-context.xml
custom-db-connection.properties
custom-data-location.properties

(In tomcat these can be found in 'tomcat/shared/classes/alfresco/extension')

custom-db-and-data-context.xml
- comment out the 'hibernateConfigProperties' bean if you are using MySQL.

custom-db-connection.properties
- used to change the MySQL connection details (such as username, password and database)

custom-data-location.properties
- used to fix where the 'alf_data' directory is located

Hope this helps,

Steve

gfrank
Champ in-the-making
Champ in-the-making
So Steve, is there a script you'd recommend using to start Alfresco on bootup?  I'm using Ubuntu 6.06, and have configured the repository properties per your recommendation.

steve
Champ in-the-making
Champ in-the-making
Hi,

Once you have 'hard coded' the alf_data location you can start Alfresco however you like.

Steve