OpenGrok revision 425278cfacbc73f1e955ab6016f206fc5ed93ccb
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# OpenGrok Wrapper (initial setup and cron job updating)
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# Supported Operating Systems:
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# - Solaris 11 (SunOS 5.11)
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# - Solaris 12 (SunOS 5.12)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - Debian (Linux)
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# Supported Deployment Engines:
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# - Glassfish
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# Supported Environment Variables:
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# - OPENGROK_NON_INTERACTIVE Suppress Progress and Warnings Messages (*)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_STANDARD_ENV Run Time Shell Environment (Shell Script)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_CONFIGURATION User Configuration (Shell Script)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Supported Environment Variables for configuring the default setup:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_DISTRIBUTION_BASE Base Directory of the OpenGrok Distribution
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_INSTANCE_BASE Base Directory of the OpenGrok User Data Area
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - EXUBERANT_CTAGS Full Path to Exuberant CTags
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_CTAGS_OPTIONS_FILE Full path to file with extra command line
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# options for CTags program (for its --options
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# switch), default is DATA_ROOT/etc/ctags.config
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - JAVA_HOME Full Path to Java Installation Root
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - JAVA Full Path to java binary (to enable 64bit JDK)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - JAVA_OPTS Java options (e.g. for JVM memory increase
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# or enabling server JDK)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# JAVA_OPTS=-Xmx2048m is the default!
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_APP_SERVER Application Server ("Tomcat" or "Glassfish")
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_WAR_TARGET_TOMCAT Tomcat Specific WAR Target Directory
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_WAR_TARGET_GLASSFISH Glassfish Specific WAR Target Directory
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_WAR_TARGET Fallback WAR Target Directory
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_TOMCAT_BASE Base Directory for Tomcat (contains webapps)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_GLASSFISH_BASE Base Directory for Glassfish
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# (contains domains)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_GLASSFISH_DOMAIN Preferred Glassfish Domain Name
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_VERBOSE Enable Verbose Mode in opengrok.jar (*)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_PROGRESS Shows progress in %(percentage) of working
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# through project, it's good to have Verbose
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Mode enabled too, cost of this is one more
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# traversal of the project before indexing it(*)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_REMOTE_REPOS Influence History Cache for (remote)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Repositories (*). Following values are
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# recognized:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# on - enabled (default)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# off - disabled for indexing and UI
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# uionly - enabled for UI only
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_SCAN_REPOS Disable Scan for repositories (*)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_SCAN_DEPTH how deep should scanning for repos go
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# (by default 3 directories from SRC_ROOT)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_WEBAPP_CFGADDR Web app address to send configuration to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# (use "none" to avoid sending it to web app)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_WEBAPP_CONTEXT Context URL of the OpenGrok webapp
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# (by default /source)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_WPREFIX Disable wildcard prefix search query
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# support (*)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_DERBY if set, then indexer tries to use derby as
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# historycache (see derby command of this
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_DERBY_URL Use specific URL to JavaDB, e.g.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# "jdbc:derby://localhost:1528/cachedb;create=true"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# (default port is 1527)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_TAG Enable parsing of revision tags into the History
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - READ_XML_CONFIGURATION file with read only configuration
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - temporary workaround for bug # 327
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# - OPENGROK_FLUSH_RAM_BUFFER_SIZE="-m 16" - set RAM buffer size for flushing,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# default is 16MB per thread, you might try to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# increase it to 256MB, but do increase JVM to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 4/8/16GB ! Lucene defaults to 8 threads.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Increase JVM memory as noted using JAVA_OPTS
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# (*) Any Non-Empty String will enable these options
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Print usage to stdout and exit.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein echo "Usage: ${progname} <deploy|derby|update|updateQuietly|usage|help>"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein echo " OPENGROK_CONFIGURATION - location of your configuration"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein echo " e.g. $ OPENGROK_CONFIGURATION=/var/opengrok/myog.conf ${0} ... "
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein echo " See the code for more information on configuration options /" \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Runtime Configuration
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# TODO: Handle symlinks correctly (especially in ${0})
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Default Instance Configuration
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Use the built-in defaults. This section can be copied to its own
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # file and tailored to your local requirements. Then simply set
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # OPENGROK_CONFIGURATION=/path/to/your/configuration, before using
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # this wrapper. It will save you hand editing in your settings
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # on each new release. A sample cron(1M) entry might look like:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # 15 0 * * * OPENGROK_CONFIGURATION=/pkgs/etc/OpenGrok.sh /pkgs/sbin/OpenGrok updateQuietly
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Note: It is not really possible to ever provided defaults for
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # these values which will run in every UNIX-like environment.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # So I have provided a set which are functional for a given
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # environment on which you can based you own configuration.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # This has been updated to support more environment variables and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # operating systems, if you have any reasonably generic
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # improvements please feel free to submit a patch.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OPENGROK_INSTANCE_BASE="${OPENGROK_INSTANCE_BASE:-/var/opengrok}"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OPENGROK_DISTRIBUTION_BASE="${SCRIPT_DIRECTORY}/dist"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein LOGGER_CONF_SOURCE="${SCRIPT_DIRECTORY}/${LOGGER_CONFIG_FILE}"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OPENGROK_DISTRIBUTION_BASE="${SCRIPT_DIRECTORY}/../lib"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein LOGGER_CONF_SOURCE="${OPENGROK_DISTRIBUTION_BASE}/../doc/"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein LOGGER_CONF_SOURCE="${LOGGER_CONF_SOURCE}${LOGGER_CONFIG_FILE}"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # (your source code or the root of all repositories)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # (for Lucene index and hypertext cross-references)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # This area is rebuilt by "update" / "updateQuietly"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # OPTIONAL: User Provided Source Path to Description Mapping
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # (The user maintained source of the generated EftarFile file)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein PATH_DESC="${OPENGROK_INSTANCE_BASE}/etc/paths.tsv"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # (the configuration used by Web/GUI interfaces)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein XML_CONFIGURATION="${OPENGROK_INSTANCE_BASE}/etc/configuration.xml"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # OPTIONAL: read only XML config, if it exists, it will be read
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein READ_XML_CONFIGURATION="${READ_XML_CONFIGURATION:-}"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein LOGGER_CONFIG_PATH="${OPENGROK_INSTANCE_BASE}/${LOGGER_CONFIG_FILE}"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein LOGGER_PROPERTIES="-Djava.util.logging.config.file=${LOGGER_CONFIG_PATH}"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # REQUIRED: Java Archive of OpenGrok (Installation Location)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OPENGROK_JAR="${OPENGROK_DISTRIBUTION_BASE}/opengrok.jar"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # REQUIRED(deploy): Web Archive of OpenGrok (Distribution Location)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # (user building from source code will find this and other key
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # files in the "dist" directory after the build is completed)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein OPENGROK_DIST_WAR="${OPENGROK_DISTRIBUTION_BASE}/source.war"
61e1dc26d62c2a0059e3ca7efe2ad0f4a5b8df92Mark Andrews # REQUIRED: Exuberant CTags (http://ctags.sf.net)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein EXUBERANT_CTAGS="${EXUBERANT_CTAGS:-`FindExuberantCTags`}"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # OPTIONAL: supply extra command line options to CTags program
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if [ -n "${OPENGROK_CTAGS_OPTIONS_FILE}" ]; then
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein CTAGS_OPTIONS_FILE="${OPENGROK_CTAGS_OPTIONS_FILE}"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein elif [ -r "${OPENGROK_INSTANCE_BASE}/etc/ctags.config" ]; then
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein CTAGS_OPTIONS_FILE="${OPENGROK_INSTANCE_BASE}/etc/ctags.config"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # DEVELOPMENT: Debug option, if enabled current indexer will listen on the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein #JAVA_DEBUG="-agentlib:jdwp=transport=dt_socket"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein #JAVA_DEBUG="$JAVA_DEBUG,server=y,address=8010,suspend=y"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # OPTIONAL: Ignore these patterns as names of files or directories
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # To ignore skipping just the history cache creation for a particular
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # directory and all of it's subdirectories, touch an empty
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # .opengrok_skip_history file at the root of that directory
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # (Every directory in SRC_ROOT is considered a separate project)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # OPTIONAL: Scanning Options (for Mercurial repositories)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # OPTIONAL: Disable remote repository support (CVS or SVN) [on by default]
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein REMOTE_REPOSITORIES="-r ${OPENGROK_REMOTE_REPOS}"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # OPTIONAL: override depth of scanning for repositories
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein WEBAPP_CONFIG_ADDRESS=${OPENGROK_WEBAPP_CFGADDR}
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if [ "${OPENGROK_WEBAPP_CFGADDR}" == "none" ]; then
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Assumption: We should not set properties to the empty string
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein${HG:+-Dorg.opensolaris.opengrok.history.Mercurial=$HG} \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein${CVS:+-Dorg.opensolaris.opengrok.history.cvs=$CVS} \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein${SVN:+-Dorg.opensolaris.opengrok.history.Subversion=$SVN} \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein${SCCS:+-Dorg.opensolaris.opengrok.history.SCCS=$SCCS} \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein${CLEARCASE:+-Dorg.opensolaris.opengrok.history.ClearCase=$CLEARCASE} \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein${GIT:+-Dorg.opensolaris.opengrok.history.git=$GIT} \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein${P4:+-Dorg.opensolaris.opengrok.history.Perforce=$P4} \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein${MTN:+-Dorg.opensolaris.opengrok.history.Monotone=$MTN} \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein${BZR:+-Dorg.opensolaris.opengrok.history.Bazaar=$BZR} \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # OPTIONAL: Store The History Cache in Java DB (derby),
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # instead of file system (in gzipped xml files).
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # - derbyclient.jar - See README.txt for more details
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # - Running Derby Server - Defaults to localhost:1527
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein DERBY_OPTIONS="${DERBY_OPTIONS} -u ${OPENGROK_DERBY_URL}"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Turn this off if you want to increase indexing performance a bit
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Usage: <class> inputFile [inputFile ...] outputFile
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # EftarFile == An Extremely Fast Tagged Attribute Read-only File System
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein EFTAR_UPDATE="org.opensolaris.opengrok.web.EftarFile"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # HARDCODED: Generated EftarFile (See web/*.jsp)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein EFTAR_OUTPUT_FILE="${DATA_ROOT}/index/dtags.eftar"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Be Quiet? (set indirectly by command line arguments in the main program)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Helper Functions - Logging
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# In general, non-interactive use like cron jobs and automated
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# installation environments should not generate unnecessary
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# progress information or warnings, as usage and configuration
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# will have generally been debugged prior to automation.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Helper Functions - Autodetection of Runtime Environment
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein binary=`LocateBinary ctags-exuberant exctags ctags`
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if test $? -eq 1
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Error "Unable to determine Exuberant CTags command name" \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein $binary --version 2>&1 | grep "Exuberant Ctags" > /dev/null
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if test $? -ne 0
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Error "Unable to determine Exuberant CTags command name" \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein "for ${OS_NAME} ${OS_VERSION}\n(${binary} is not Exuberant CTags)"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein SunOS:5.10) javaHome="/usr/jdk/instances/jdk1.7.0" ;;
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein javaHome=`ls -l /etc/alternatives/java | cut -f 2 -d \> `
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Use this function to determine which environment the deploy the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # web application function into. Some users (especially
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # developers) will have many deployment environments or will wish
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # to specify directly the application server to deploy to.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Either use the environment variable OPENGROK_APP_SERVER or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # reimplement this function in your configuration file (as
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # This implementation favours Tomcat, but needs a lot of work,
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson # especially if Glassfish is perferrerd or it is under the control
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Maybe a better implementation would be to call Application
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # Server specific WAR Directory and see if they exist.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if [ -x "/etc/init.d/appserv" -a -d "/var/appserver/domains" ]
if [ ! -d ${OPENGROK_INSTANCE_BASE}/log ]
${DO} mkdir ${OPENGROK_INSTANCE_BASE}/log
${DO} mkdir -p ${OPENGROK_INSTANCE_BASE}/derby
${DO} ${JAVA} ${JAVA_OPTS} ${PROPERTIES} \
${LOGGER_PROPERTIES} \
${JAVA_DEBUG} \
-jar ${OPENGROK_JAR} \
${IGNORE_PATTERNS} ${ENABLE_PROJECTS} \
${DERBY_OPTIONS} \
${HISTORY_TAGS} \
${SCAN_DEPTH} \
${PROGRESS} \
${EXUBERANT_CTAGS:+-c} ${EXUBERANT_CTAGS} \
${CTAGS_OPTIONS_FILE:+-o} ${CTAGS_OPTIONS_FILE} \
${OPENGROK_FLUSH_RAM_BUFFER_SIZE} ${SKIN} ${LEADING_WILDCARD} \
${READ_XML_CONF} \
-W ${XML_CONFIGURATION} \
${WEBAPP_CONFIG} \
${WEBAPP_CONTEXT} \
${DO} ${JAVA} -classpath ${OPENGROK_JAR} \
${EFTAR_UPDATE} ${PATH_DESC} ${EFTAR_OUTPUT_FILE}
SunOS:5.11)
SunOS:5.12)
mkdir -p $DATA_ROOT/derby
Linux:*)
mkdir -p $DATA_ROOT/derby