3 if [ -e ./@target@ ] && [ -e ./Makefile.am ] ; then
4 echo "Running uninstalled @target@."
6 # When we run uninstalled, run in the foreground by default.
9 TARGET_EXE="./@target@"
12 export _BEAGLED_INDEX_HELPER_PATH="."
14 # The stuff in webserver, Tiles and images is only needed when
15 # web services are enabled.
16 export MONO_PATH="../Util:../BeagleClient:./webserver:../Tiles:../images:$MONO_PATH"
18 export LD_LIBRARY_PATH="../glue/.libs:$LD_LIBRARY_PATH"
20 # In BEAGLE_FILTER_PATH, a trailing ':' means "append the default path".
21 if [ -n "$BEAGLE_FILTER_PATH" ]; then
22 export BEAGLE_FILTER_PATH="../Filters:$BEAGLE_FILTER_PATH"
24 export BEAGLE_FILTER_PATH="../Filters"
28 # Otherwise default to running in the background
31 TARGET_EXE="@pkglibdir@/@target@"
34 export _BEAGLED_INDEX_HELPER_PATH="@pkglibdir@"
35 export MONO_PATH="@pkglibdir@:$MONO_PATH"
36 export LD_LIBRARY_PATH="@pkglibdir@:$LD_LIBRARY_PATH"
39 # This disables mono's emulation of the win32 file locking semantics,
40 # which speeds up lucene.
42 # ... but they also make things pretty unstable on Mono 1.1.x,
43 # including calling out to processes non-functional.
44 #export MONO_DISABLE_SHM=1
46 export MONO_GAC_PREFIX="@gacprefix@:$MONO_GAC_PREFIX"
47 export LD_LIBRARY_PATH="/opt/gnome/lib/evolution/2.0:$LD_LIBRARY_PATH"
52 for i in $BEAGLED_ARGS; do
54 --help | --list-backends | --fg | --foreground ) fg_user=1 ;;
55 --bg | --background ) fg_user=0 ;;
56 --monogrind ) monogrind=1 ;;
57 --heap-buddy ) heap_buddy=1 ;;
61 # If the user didn't specify to run in fg/bg, then use the default
62 if [ -z "$fg_user" ]; then
68 # Handle logging, and optionally append the relevent default fg/bg argument if
69 # it was not user-specified.
70 if [ $fg -eq 1 ]; then
71 [ -z "$fg_user" ] && FGBG_ARG="--fg";
72 export BEAGLE_LOG_IN_THE_FOREGROUND_PLEASE=1
74 [ -z "$fg_user" ] && FGBG_ARG="--bg";
75 unset BEAGLE_LOG_IN_THE_FOREGROUND_PLEASE
78 if [ $heap_buddy -eq 1 ]; then
79 export _GET_ON_THE_HEAP_BUDDY_BANDWAGON=1
80 MONO_EXTRA_ARGS="--profile=heap-buddy:outfile.beagled $MONO_EXTRA_ARGS"
81 rm -f outfile.beagled outfile.helper.*
84 if [ $monogrind -eq 1 ]; then
86 CMDLINE="monogrind $TARGET_EXE $EXTRA_ARGS $BEAGLED_ARGS $FGBG_ARG"
88 CMDLINE="mono --debug $MONO_EXTRA_ARGS $TARGET_EXE $EXTRA_ARGS $BEAGLED_ARGS $FGBG_ARG"
91 PROCESS_NAME="mono-beagled"
93 if [ $fg -eq 1 ]; then
94 exec -a $PROCESS_NAME $CMDLINE
97 exec -a $PROCESS_NAME $CMDLINE &
100 # If beagled (in --bg mode) has exited with some errors, we need
101 # to inform the users about the same. This 500 milli-seconds sleep
102 # is to wait for the daemon to start and exit, in case of errors ;)
103 # Fixes http://bugzilla.gnome.org/show_bug.cgi?id=171975
107 if ! ps -p $! > /dev/null; then
108 echo "Beagle Daemon exited with errors. See ~/.beagle/Log/current-Beagle for more details."