#25 Symbolic links to start script not followed

open
nobody
None
5
2008-05-21
2008-05-21
Mathieu Baudier
No

Hi,

if you make a symbolic link to the standalone-start.sh script under LInux (Fedora 8 in my case), the home directory is not properly set and the jars are not found.

The following fix is working (originally from Ant start script):

#!/bin/sh
#
# Run GCALDaemon
#

# commented out by mbaudier@argeo.org - 2008-05-21
#GCALDIR=`dirname "$0"`/..

# added by mbaudier@argeo.org - 2008-05-21
# Find home
if [ -z "$GCALDIR" -o ! -d "$GCALDIR" ] ; then
## resolve links - $0 may be a link to home
PRG="$0"
progname=`basename "$0"`

# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done

GCALDIR=`dirname "$PRG"`/..

# make it fully qualified
GCALDIR=`cd "$GCALDIR" && pwd`
fi
...

Cheers,

Mathieu

Discussion