corrected start of listen
parent
42fc9f04b3
commit
39a4fcc242
21
Dockerfile
21
Dockerfile
|
|
@ -1,20 +1,11 @@
|
||||||
FROM ubuntu:16.04
|
FROM ubuntu:16.04
|
||||||
|
|
||||||
MAINTAINER Jonathan A. Schweder "jonathanschweder@gmail.com"
|
COPY ./sqlanywhere16 /opt/sqlanywhere16
|
||||||
|
|
||||||
ARG SYBASE_KEY=''
|
ENV LD_LIBRARY_PATH="/opt/sqlanywhere16/lib64"
|
||||||
|
|
||||||
RUN mkdir /usr/src/ext \
|
ENV PATH="/opt/sqlanywhere16/bin64:${PATH}"
|
||||||
&& cd /usr/src/ext \
|
|
||||||
&& wget http://d5d4ifzqzkhwt.cloudfront.net/sqla16client/sqla16_client_linux_x86x64.tar.gz \
|
|
||||||
&& tar -xvf sqla16_client_linux_x86x64.tar.gz \
|
|
||||||
&& cd client1600 \
|
|
||||||
&& ./setup \
|
|
||||||
-silent \
|
|
||||||
-nogui \
|
|
||||||
-I_accept_the_license_agreement \
|
|
||||||
-sqlany-dir /opt/sqlanywhere16 \
|
|
||||||
-regkey $SYBASE_KEY \
|
|
||||||
&& rm -rf /usr/src/ext
|
|
||||||
|
|
||||||
ENV LD_LIBRARY_PATH=/opt/sqlanywhere16/lib64
|
ENTRYPOINT ["dbsrv16"]
|
||||||
|
|
||||||
|
CMD ["/opt/sqlanywhere16/demo.db"]
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
See more about this image at [Docker Hub](https://hub.docker.com/r/jaschweder/sybase)
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
# Version: 16.0.0.2043
|
||||||
|
# Tue Mar 07 11:29:49 UTC 2017
|
||||||
|
#
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Name=SQL Anywhere 16 Demo
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/FirstTimeStart=false
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Description=Connection Profile for SQL Anywhere 16 Demo database
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/ProviderId=sqlanywhere1600
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Provider=SQL Anywhere 16
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Data/ConnectionProfileSettings=DSN\eSQL^0020Anywhere^002016^0020Demo;UID\eDBA;PWD\e35c624d517fb
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Data/ConnectionProfileName=SQL Anywhere 16 Demo
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Data/ConnectionProfileType=SQL Anywhere
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
SCRepositoryInfo/Version=4
|
||||||
|
#
|
||||||
|
Providers/mobilink1600/Version=
|
||||||
|
Providers/mobilink1600/UseClassloader=true
|
||||||
|
Providers/mobilink1600/GrantStatements=
|
||||||
|
Providers/mobilink1600/Classpath=\_opt\_sqlanywhere16\_java\_mlplugin.jar
|
||||||
|
Providers/mobilink1600/ClassloaderId=SA1600
|
||||||
|
Providers/mobilink1600/Name=mlplugin.jar
|
||||||
|
Providers/mobilink1600/AdditionalClasspath=\_opt\_sqlanywhere16\_java\_isql.jar:\_opt\_sqlanywhere16\_java\_salib.jar:\_opt\_sqlanywhere16\_java\_JComponents1600.jar:\_opt\_sqlanywhere16\_java\_jlogon.jar:\_opt\_sqlanywhere16\_java\_mldesign.jar:\_opt\_sqlanywhere16\_java\_jodbc4.jar:\_opt\_sqlanywhere16\_java\_stax-api-1.0.jar:\_opt\_sqlanywhere16\_java\_wstx-asl-3.2.6.jar:\_opt\_sqlanywhere16\_java\_velocity-1.7-dep.jar
|
||||||
|
Providers/mobilink1600/Provider=com.sybase.mobilink.plugin.MLPlugin
|
||||||
|
Providers/mobilink1600/ProviderId=mobilink1600
|
||||||
|
Providers/mobilink1600/InitialLoadOrder=2
|
||||||
|
#
|
||||||
|
Providers/sqlanywhere1600/Version=
|
||||||
|
Providers/sqlanywhere1600/UseClassloader=true
|
||||||
|
Providers/sqlanywhere1600/GrantStatements=
|
||||||
|
Providers/sqlanywhere1600/Classpath=\_opt\_sqlanywhere16\_java\_saplugin.jar
|
||||||
|
Providers/sqlanywhere1600/ClassloaderId=SA1600
|
||||||
|
Providers/sqlanywhere1600/Name=saplugin.jar
|
||||||
|
Providers/sqlanywhere1600/AdditionalClasspath=\_opt\_sqlanywhere16\_java\_isql.jar:\_opt\_sqlanywhere16\_java\_salib.jar:\_opt\_sqlanywhere16\_java\_JComponents1600.jar:\_opt\_sqlanywhere16\_java\_jlogon.jar:\_opt\_sqlanywhere16\_java\_debugger.jar:\_opt\_sqlanywhere16\_java\_jodbc4.jar:\_opt\_sqlanywhere16\_java\_batik-anim.jar:\_opt\_sqlanywhere16\_java\_batik-awt-util.jar:\_opt\_sqlanywhere16\_java\_batik-bridge.jar:\_opt\_sqlanywhere16\_java\_batik-codec.jar:\_opt\_sqlanywhere16\_java\_batik-css.jar:\_opt\_sqlanywhere16\_java\_batik-dom.jar:\_opt\_sqlanywhere16\_java\_batik-ext.jar:\_opt\_sqlanywhere16\_java\_batik-extension.jar:\_opt\_sqlanywhere16\_java\_batik-gui-util.jar:\_opt\_sqlanywhere16\_java\_batik-gvt.jar:\_opt\_sqlanywhere16\_java\_batik-parser.jar:\_opt\_sqlanywhere16\_java\_batik-script.jar:\_opt\_sqlanywhere16\_java\_batik-svg-dom.jar:\_opt\_sqlanywhere16\_java\_batik-svggen.jar:\_opt\_sqlanywhere16\_java\_batik-swing.jar:\_opt\_sqlanywhere16\_java\_batik-transcoder.jar:\_opt\_sqlanywhere16\_java\_batik-util.jar:\_opt\_sqlanywhere16\_java\_batik-xml.jar:\_opt\_sqlanywhere16\_java\_pdf-transcoder.jar:\_opt\_sqlanywhere16\_java\_xerces_2_5_0.jar:\_opt\_sqlanywhere16\_java\_xml-apis-ext.jar:\_opt\_sqlanywhere16\_java\_xml-apis.jar:\_opt\_sqlanywhere16\_java\_dbdiff.jar:\_opt\_sqlanywhere16\_java\_diffutils-1.2.1.jar
|
||||||
|
Providers/sqlanywhere1600/Provider=ianywhere.sa.plugin.SAPlugin
|
||||||
|
Providers/sqlanywhere1600/ProviderId=sqlanywhere1600
|
||||||
|
Providers/sqlanywhere1600/InitialLoadOrder=1
|
||||||
|
#
|
||||||
|
Providers/relayserver1600/Version=
|
||||||
|
Providers/relayserver1600/UseClassloader=true
|
||||||
|
Providers/relayserver1600/GrantStatements=
|
||||||
|
Providers/relayserver1600/ClassloaderId=SA1600
|
||||||
|
Providers/relayserver1600/Classpath=\_opt\_sqlanywhere16\_java\_rsplugin.jar
|
||||||
|
Providers/relayserver1600/Name=rsplugin.jar
|
||||||
|
Providers/relayserver1600/AdditionalClasspath=\_opt\_sqlanywhere16\_java\_salib.jar:\_opt\_sqlanywhere16\_java\_jlogon.jar:\_opt\_sqlanywhere16\_java\_JComponents1600.jar:\_opt\_sqlanywhere16\_java\_rstool.jar
|
||||||
|
Providers/relayserver1600/Provider=com.sybase.relayserver.plugin.RSPlugin
|
||||||
|
Providers/relayserver1600/ProviderId=relayserver1600
|
||||||
|
Providers/relayserver1600/InitialLoadOrder=3
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
# Version: 16.0.0.2043
|
||||||
|
# Tue Mar 07 11:29:49 UTC 2017
|
||||||
|
#
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Name=SQL Anywhere 16 Demo
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/FirstTimeStart=false
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Description=Connection Profile for SQL Anywhere 16 Demo database
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/ProviderId=sqlanywhere1600
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Provider=SQL Anywhere 16
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Data/ConnectionProfileSettings=DSN\eSQL^0020Anywhere^002016^0020Demo;UID\eDBA;PWD\e35c624d517fb
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Data/ConnectionProfileName=SQL Anywhere 16 Demo
|
||||||
|
ConnectionProfiles/SQL Anywhere 16 Demo/Data/ConnectionProfileType=SQL Anywhere
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
SCRepositoryInfo/Version=4
|
||||||
|
#
|
||||||
|
Providers/mobilink1600/Version=
|
||||||
|
Providers/mobilink1600/UseClassloader=true
|
||||||
|
Providers/mobilink1600/GrantStatements=
|
||||||
|
Providers/mobilink1600/ClassloaderId=SA1600
|
||||||
|
Providers/mobilink1600/Classpath=\_opt\_sqlanywhere16\_java\_mlplugin.jar
|
||||||
|
Providers/mobilink1600/Name=mlplugin.jar
|
||||||
|
Providers/mobilink1600/AdditionalClasspath=\_opt\_sqlanywhere16\_java\_isql.jar:\_opt\_sqlanywhere16\_java\_salib.jar:\_opt\_sqlanywhere16\_java\_JComponents1600.jar:\_opt\_sqlanywhere16\_java\_jlogon.jar:\_opt\_sqlanywhere16\_java\_mldesign.jar:\_opt\_sqlanywhere16\_java\_jodbc4.jar:\_opt\_sqlanywhere16\_java\_stax-api-1.0.jar:\_opt\_sqlanywhere16\_java\_wstx-asl-3.2.6.jar:\_opt\_sqlanywhere16\_java\_velocity-1.7-dep.jar
|
||||||
|
Providers/mobilink1600/Provider=com.sybase.mobilink.plugin.MLPlugin
|
||||||
|
Providers/mobilink1600/ProviderId=mobilink1600
|
||||||
|
Providers/mobilink1600/InitialLoadOrder=2
|
||||||
|
#
|
||||||
|
Providers/sqlanywhere1600/Version=
|
||||||
|
Providers/sqlanywhere1600/UseClassloader=true
|
||||||
|
Providers/sqlanywhere1600/GrantStatements=
|
||||||
|
Providers/sqlanywhere1600/Classpath=\_opt\_sqlanywhere16\_java\_saplugin.jar
|
||||||
|
Providers/sqlanywhere1600/ClassloaderId=SA1600
|
||||||
|
Providers/sqlanywhere1600/Name=saplugin.jar
|
||||||
|
Providers/sqlanywhere1600/AdditionalClasspath=\_opt\_sqlanywhere16\_java\_isql.jar:\_opt\_sqlanywhere16\_java\_salib.jar:\_opt\_sqlanywhere16\_java\_JComponents1600.jar:\_opt\_sqlanywhere16\_java\_jlogon.jar:\_opt\_sqlanywhere16\_java\_debugger.jar:\_opt\_sqlanywhere16\_java\_jodbc4.jar:\_opt\_sqlanywhere16\_java\_batik-anim.jar:\_opt\_sqlanywhere16\_java\_batik-awt-util.jar:\_opt\_sqlanywhere16\_java\_batik-bridge.jar:\_opt\_sqlanywhere16\_java\_batik-codec.jar:\_opt\_sqlanywhere16\_java\_batik-css.jar:\_opt\_sqlanywhere16\_java\_batik-dom.jar:\_opt\_sqlanywhere16\_java\_batik-ext.jar:\_opt\_sqlanywhere16\_java\_batik-extension.jar:\_opt\_sqlanywhere16\_java\_batik-gui-util.jar:\_opt\_sqlanywhere16\_java\_batik-gvt.jar:\_opt\_sqlanywhere16\_java\_batik-parser.jar:\_opt\_sqlanywhere16\_java\_batik-script.jar:\_opt\_sqlanywhere16\_java\_batik-svg-dom.jar:\_opt\_sqlanywhere16\_java\_batik-svggen.jar:\_opt\_sqlanywhere16\_java\_batik-swing.jar:\_opt\_sqlanywhere16\_java\_batik-transcoder.jar:\_opt\_sqlanywhere16\_java\_batik-util.jar:\_opt\_sqlanywhere16\_java\_batik-xml.jar:\_opt\_sqlanywhere16\_java\_pdf-transcoder.jar:\_opt\_sqlanywhere16\_java\_xerces_2_5_0.jar:\_opt\_sqlanywhere16\_java\_xml-apis-ext.jar:\_opt\_sqlanywhere16\_java\_xml-apis.jar:\_opt\_sqlanywhere16\_java\_dbdiff.jar:\_opt\_sqlanywhere16\_java\_diffutils-1.2.1.jar
|
||||||
|
Providers/sqlanywhere1600/Provider=ianywhere.sa.plugin.SAPlugin
|
||||||
|
Providers/sqlanywhere1600/ProviderId=sqlanywhere1600
|
||||||
|
Providers/sqlanywhere1600/InitialLoadOrder=1
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,4 @@
|
||||||
|
u¤WgCk<19>QΜhp3~‡?GΕ<47>³RΩή¨'ΐ γµGuΝvλμΡl±xv.όδ<CF8C>Φΐ<CEA6>"<ΌqΝ&ο’Ω‚¥ΌΡ,ιh½<68>%Ή¥UhΫδΑ
|
||||||
|
€<>>¬JΑvvI¨³©:w'=Ξµυ¦ρMg0τ09νΑ‚<CE91>λF6Σ~03υƒ•ϋ§H<01>³χ|η6Εh!jΛ“Χ)IX<49>+εa`T[<0F><>f PΈΪ¥ϊGVUύ1jχΥ^jϊΙ…ήΧraH %ςΥN;ΘΎ¦΅΅.½<>Ξ<EFBFBD>§<EFBFBD>ΞώΑ—§ά)(<28>gΩτχ@}I
2|ξ<>|+Ιz<CE99>ζ~³1o<31><6F>V<C2AD>ε–ύjNΩ™T<E284A2>#ϋ<>vΖf’H±- ΘCΏ_“¶vωΧόS"ό}ƒ<>ΉE{όM"}\ΥΓ:ϊ
|
||||||
|
.ΫΚ–fΥ‘³Λ2<CE9B>7Ο ½ί#pΙ<70><CE99>΄·|=ΕζIΉ–j~)Ι]<5D>Z¦lJ…wΩ«,?(›
|
||||||
|
—Ίπ™3H±“< †2τ(½ϊdά<64>\S
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,897 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# In case we are being run by a service, set some stock paths
|
||||||
|
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/opt/usr/bin:/opt/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH"
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
get_major_version()
|
||||||
|
###################
|
||||||
|
{
|
||||||
|
echo "16"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_minor_version()
|
||||||
|
###################
|
||||||
|
{
|
||||||
|
echo "0"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_patch_version()
|
||||||
|
###################
|
||||||
|
{
|
||||||
|
echo "0"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_build_version()
|
||||||
|
###################
|
||||||
|
{
|
||||||
|
echo "2043"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_full_version()
|
||||||
|
##################
|
||||||
|
{
|
||||||
|
echo "16.0.0.2043"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_version()
|
||||||
|
#############
|
||||||
|
{
|
||||||
|
echo "`get_major_version``get_minor_version``get_patch_version`"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_lang_code()
|
||||||
|
###############
|
||||||
|
{
|
||||||
|
if [ "$LANG" != "" ]; then
|
||||||
|
LANGCODE=`echo $LANG | awk -F"_" '{print $1}'`
|
||||||
|
else
|
||||||
|
LANGCODE="en"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $LANGCODE
|
||||||
|
}
|
||||||
|
|
||||||
|
get_res_charset_code()
|
||||||
|
######################
|
||||||
|
{
|
||||||
|
echo $RESCHARSET
|
||||||
|
}
|
||||||
|
|
||||||
|
get_os_charset_code()
|
||||||
|
#####################
|
||||||
|
{
|
||||||
|
if [ "$LANG" != "" ]; then
|
||||||
|
CHARSET=`echo $LANG | awk -F"." '{print $2}'`
|
||||||
|
fi
|
||||||
|
if [ "$CHARSET" = "" ]; then
|
||||||
|
CHARSET="LATIN1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $CHARSET
|
||||||
|
}
|
||||||
|
|
||||||
|
create_new_tmpfile()
|
||||||
|
####################
|
||||||
|
# PRE : none
|
||||||
|
# POST: new empty file $TMPFILE created.
|
||||||
|
{
|
||||||
|
TMPPREFIX="/tmp/SqlAny_dbsvc."
|
||||||
|
|
||||||
|
if [ "_$TMPFILE" != "_" ] && [ -f "$TMPFILE" ]; then
|
||||||
|
rm -f "$TMPFILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
TMPFILE="${TMPPREFIX}$$"
|
||||||
|
|
||||||
|
touch $TMPFILE
|
||||||
|
}
|
||||||
|
|
||||||
|
check_os_requirements()
|
||||||
|
#######################
|
||||||
|
{
|
||||||
|
if [ ! -r "$INIT_FUNCS" ]; then
|
||||||
|
output_fatal_error "${ERR_EXPECTINGFILES}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_bitness()
|
||||||
|
#############
|
||||||
|
# called only when in "utility" mode
|
||||||
|
{
|
||||||
|
MY_DIR=`dirname "$0"`
|
||||||
|
OCWD=`pwd`
|
||||||
|
cd "$MY_DIR"
|
||||||
|
|
||||||
|
BIN=`echo $PWD | awk -F bin32 '{ print $1 }' | grep bin64`
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "64"
|
||||||
|
else
|
||||||
|
echo "32"
|
||||||
|
fi
|
||||||
|
cd "$OCWD"
|
||||||
|
}
|
||||||
|
|
||||||
|
opposite_bitness()
|
||||||
|
##################
|
||||||
|
{
|
||||||
|
if [ "${1:-}" = "32" ]; then
|
||||||
|
echo 64
|
||||||
|
elif [ "${1:-}" = "64" ]; then
|
||||||
|
echo 32
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
load_language_file()
|
||||||
|
####################
|
||||||
|
{
|
||||||
|
# something to fall back on
|
||||||
|
. "${DBSVC_DIR}/language/en/messages.txt"
|
||||||
|
|
||||||
|
local lc
|
||||||
|
lc=`get_lang_code`
|
||||||
|
|
||||||
|
case $lc in
|
||||||
|
"ja" )
|
||||||
|
;;
|
||||||
|
"zh" )
|
||||||
|
;;
|
||||||
|
"de" )
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
lc="en"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
RESCHARSET="UTF8"
|
||||||
|
|
||||||
|
if [ "$LANGCODE" != "en" ]; then
|
||||||
|
create_new_tmpfile
|
||||||
|
if [ -r "${DBSVC_DIR}/language/$lc/messages.txt" ]; then
|
||||||
|
iconv -f $RESCHARSET -t `get_os_charset_code` "${DBSVC_DIR}/language/$lc/messages.txt" > $TMPFILE 2>/dev/null
|
||||||
|
fi
|
||||||
|
# Only override usage if we were able to convert to their charset; otherwise fall back on english
|
||||||
|
[ $? -eq 0 ] && . $TMPFILE
|
||||||
|
fi
|
||||||
|
rm -f $TMPFILE
|
||||||
|
}
|
||||||
|
|
||||||
|
get_abspath()
|
||||||
|
{
|
||||||
|
# assumes a path to a file is passed in
|
||||||
|
|
||||||
|
local dir=`dirname $1`
|
||||||
|
local file=`basename $1`
|
||||||
|
|
||||||
|
odir=`pwd`
|
||||||
|
cd $dir
|
||||||
|
dir=`pwd`
|
||||||
|
cd $odir
|
||||||
|
|
||||||
|
echo $dir/$file
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
init()
|
||||||
|
###########
|
||||||
|
# initialization that is common for both modes of operation:
|
||||||
|
# "svc" mode and "utility" mode
|
||||||
|
{
|
||||||
|
SVCNAME_PFX="SA_"
|
||||||
|
VERSION=`get_major_version`
|
||||||
|
INIT_FUNCS=/lib/lsb/init-functions
|
||||||
|
|
||||||
|
SCRIPT="`get_abspath $0`"
|
||||||
|
SCRIPTDIR="`dirname $SCRIPT`"
|
||||||
|
SCRIPTPARENTDIR="`dirname $SCRIPTDIR`"
|
||||||
|
|
||||||
|
SQLANYDIR="$SQLANY16"
|
||||||
|
if [ -z "$SQLANYDIR" ]; then
|
||||||
|
# fall back on canonical SQL Anywhere directory structure
|
||||||
|
SQLANYDIR="$SCRIPTPARENTDIR"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
init_utility()
|
||||||
|
###################
|
||||||
|
{
|
||||||
|
# figure out bitness
|
||||||
|
BITNESS=`get_bitness`
|
||||||
|
BIN=bin${BITNESS}
|
||||||
|
OBIN=bin`opposite_bitness ${BITNESS}`
|
||||||
|
|
||||||
|
DBSVC_DIR="$SQLANYDIR/$BIN"
|
||||||
|
if [ ! -d "${DBSVC_DIR}/dbsvc_scripts" ]; then
|
||||||
|
DBSVC_DIR="$SQLANYDIR/$OBIN"
|
||||||
|
fi
|
||||||
|
BIN32=bin32
|
||||||
|
BIN64=bin64
|
||||||
|
|
||||||
|
QUIET=0
|
||||||
|
AUTOYES=0
|
||||||
|
LISTCMD=FALSE
|
||||||
|
|
||||||
|
DBSVC_TYPE="Personal"
|
||||||
|
}
|
||||||
|
|
||||||
|
init_svc()
|
||||||
|
###############
|
||||||
|
{
|
||||||
|
BITNESS=${BITNESS:-32}
|
||||||
|
BIN=bin${BITNESS}
|
||||||
|
OBIN=bin`opposite_bitness ${BITNESS}`
|
||||||
|
BIN32=bin32
|
||||||
|
BIN64=bin64
|
||||||
|
DBSVC_DIR="$SQLANYDIR/$BIN"
|
||||||
|
}
|
||||||
|
|
||||||
|
usage()
|
||||||
|
#######
|
||||||
|
{
|
||||||
|
FV=`echo "FULL"_"VERSION"`
|
||||||
|
MJR=`echo "SA"_"MAJOR"`
|
||||||
|
|
||||||
|
local lc
|
||||||
|
lc=`get_lang_code`
|
||||||
|
|
||||||
|
create_new_tmpfile
|
||||||
|
if [ -r "${DBSVC_DIR}/language/$lc/messages.txt" ]; then
|
||||||
|
iconv -f `get_res_charset_code` -t `get_os_charset_code` "${DBSVC_DIR}/language/`get_lang_code`/usage.txt" > $TMPFILE 2>/dev/null
|
||||||
|
# Only override usage if we were able to convert to their charset; otherwise fall back on english
|
||||||
|
[ $? -ne 0 ] && cat "${DBSVC_DIR}/language/en/usage.txt" > $TMPFILE
|
||||||
|
else
|
||||||
|
cat "${DBSVC_DIR}/language/en/usage.txt" > $TMPFILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat $TMPFILE | sed -e "s/${FV}/`get_full_version`/" | sed -e "s/${MJR}/`get_major_version`/"
|
||||||
|
rm -f $TMPFILE
|
||||||
|
|
||||||
|
[ "F$1" = "F-?" ] && exit 0
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
echobanner()
|
||||||
|
############
|
||||||
|
{
|
||||||
|
[ ${QUIET:-0} -ne 0 ] && return ;
|
||||||
|
|
||||||
|
output_msg "$BANNER `get_full_version`"
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteservice()
|
||||||
|
###############
|
||||||
|
{
|
||||||
|
echobanner
|
||||||
|
CWD=`pwd`;
|
||||||
|
cd ${SVCDIR}
|
||||||
|
|
||||||
|
if [ -r $SVCNAME_PFX$SERVICENAME ]; then
|
||||||
|
if not cui_ask_y_n "${PRMPT_DELETE}" "N" ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
stopservice >/dev/null 2>/dev/null
|
||||||
|
disableservice
|
||||||
|
rm -f $SVCNAME_PFX$SERVICENAME
|
||||||
|
dbsvc_iface_checkdeletedsvc
|
||||||
|
|
||||||
|
else
|
||||||
|
output_msg "${INF_NOSERVICENAME}" # $SERVICENAME
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd $CWD
|
||||||
|
}
|
||||||
|
|
||||||
|
detailservice()
|
||||||
|
###############
|
||||||
|
{
|
||||||
|
echobanner
|
||||||
|
CWD=`pwd`;
|
||||||
|
cd ${SVCDIR}
|
||||||
|
|
||||||
|
local output
|
||||||
|
if [ -r $SVCNAME_PFX$SERVICENAME ]; then
|
||||||
|
output=`cat $SVCNAME_PFX$SERVICENAME | grep = | grep -v TMP= | grep -v "internal use" | sort`
|
||||||
|
if [ "$LISTCMD" = "TRUE" ]; then
|
||||||
|
output=`echo "$output" | grep -v INPUTCMD=`
|
||||||
|
output="$output"$'\n'$'\n'
|
||||||
|
output="$output"`cat $SVCNAME_PFX$SERVICENAME | grep INPUTCMD`
|
||||||
|
fi
|
||||||
|
echo "$output"
|
||||||
|
else
|
||||||
|
output_msg "${INF_NOSERVICENAME}" # $SERVICENAME
|
||||||
|
fi
|
||||||
|
cd $CWD
|
||||||
|
}
|
||||||
|
|
||||||
|
listservices()
|
||||||
|
##############
|
||||||
|
{
|
||||||
|
SNAME=""
|
||||||
|
echobanner
|
||||||
|
CWD=`pwd`;
|
||||||
|
cd ${SVCDIR};
|
||||||
|
|
||||||
|
for j in `ls ${SVCNAME_PFX}* 2>/dev/null `; do
|
||||||
|
SNAME=`echo $j | awk -F "$SVCNAME_PFX" '{ print $2 }'`
|
||||||
|
echo $SNAME
|
||||||
|
if [ "$LISTCMD" = "TRUE" ]; then
|
||||||
|
cat $j | grep INPUTCMD
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ "$SNAME" = "" ]; then
|
||||||
|
output_msg "${INF_NOSERVICE}"
|
||||||
|
fi
|
||||||
|
cd $CWD
|
||||||
|
}
|
||||||
|
|
||||||
|
startservice()
|
||||||
|
##############
|
||||||
|
{
|
||||||
|
I="$PREFIX"$SERVICENAME
|
||||||
|
if [ -r "$I" ]; then
|
||||||
|
$I start
|
||||||
|
else
|
||||||
|
output_msg "${INF_NOSERVICENAME}" # $SERVICENAME
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
stopservice()
|
||||||
|
#############
|
||||||
|
{
|
||||||
|
I="$PREFIX"$SERVICENAME
|
||||||
|
if [ -r "$I" ]; then
|
||||||
|
$I stop
|
||||||
|
else
|
||||||
|
output_msg "${INF_NOSERVICENAME}" # $SERVICENAME
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
statusservice()
|
||||||
|
###############
|
||||||
|
{
|
||||||
|
I="$PREFIX"$SERVICENAME
|
||||||
|
if [ -r "$I" ]; then
|
||||||
|
$I status
|
||||||
|
else
|
||||||
|
output_msg "${INF_NOSERVICENAME}" # $SERVICENAME
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echoconfiginfo()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
local RUNLEVELS=`echo $RUNLEVEL | sed 's/[0-9]/& /g'`
|
||||||
|
local STOPLEVELS=`echo $RUNLEVELS , 0 1 2 3 4 5 6 | sed 's@ @\n@g' | sort | uniq -u | sed 's@,@S@'`
|
||||||
|
STOPLEVELS=`echo $STOPLEVELS`
|
||||||
|
local SYS_DEP_SERVICES="\$local_fs \$network"
|
||||||
|
if is_redhat; then
|
||||||
|
SYS_DEP_SERVICES="$SYS_DEP_SERVICES \$NetworkManager"
|
||||||
|
fi
|
||||||
|
local DEP_SERVICES=`echo $SYS_DEP_SERVICES $DEP_SERVICES | sed 's@ @\n@g' | sort | uniq`
|
||||||
|
DEP_SERVICES=`echo $DEP_SERVICES`
|
||||||
|
|
||||||
|
local PROVIDES=SQLAnywhere_$DBSVC_TYPE_$SERVICENAME
|
||||||
|
local DESCRIPTION="Start/Stop $PROVIDES service"
|
||||||
|
|
||||||
|
echo "#!/bin/bash" >$PREFIX$SERVICENAME;
|
||||||
|
echo "" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# In case we are being run from another service, set some stock paths">>$PREFIX$SERVICENAME;
|
||||||
|
|
||||||
|
echo "PATH=\"/bin:/sbin:/usr/bin:/usr/sbin:/opt/usr/bin:/opt/usr/sbin:/usr/local/bin:/usr/local/sbin\"" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "#" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# ${CPYRIGHT1}">>$PREFIX$SERVICENAME;
|
||||||
|
echo "# ${CPYRIGHT2}">>$PREFIX$SERVICENAME;
|
||||||
|
echo "# ${CPYRIGHT3}">>$PREFIX$SERVICENAME;
|
||||||
|
echo "#" >>$PREFIX$SERVICENAME;
|
||||||
|
if [ ${HAS_CHKCONFIG:-0} -ne 0 ]; then
|
||||||
|
echo "# $PROVIDES $DESCRIPTION" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "#" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# chkconfig: $RUNLEVEL 20 80" >>$PREFIX$SERVICENAME;
|
||||||
|
fi
|
||||||
|
echo "### BEGIN INIT INFO " >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# Provides: $PROVIDES" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# Required-Start: $DEP_SERVICES" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# Required-Stop: $DEP_SERVICES" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# Default-Start: $RUNLEVELS" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# Default-Stop: $STOPLEVELS" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# Description: $DESCRIPTION" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "### END INIT INFO " >>$PREFIX$SERVICENAME;
|
||||||
|
echo "" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# Source function library.">>$PREFIX$SERVICENAME;
|
||||||
|
echo ". $INIT_FUNCS">>$PREFIX$SERVICENAME;
|
||||||
|
echo "" >>$PREFIX$SERVICENAME;
|
||||||
|
|
||||||
|
chmod u+x $PREFIX$SERVICENAME
|
||||||
|
if [ "$STARTUP" = "Automatic" ]; then
|
||||||
|
enableservice
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
enableservice()
|
||||||
|
###############
|
||||||
|
{
|
||||||
|
dbsvc_iface_installsvc
|
||||||
|
}
|
||||||
|
|
||||||
|
disableservice()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
dbsvc_iface_uninstallsvc
|
||||||
|
}
|
||||||
|
|
||||||
|
createservice()
|
||||||
|
###############
|
||||||
|
{
|
||||||
|
echobanner
|
||||||
|
if [ -r $PREFIX$SERVICENAME ] ; then
|
||||||
|
if not cui_ask_y_n "${PRMPT_OVERWRITE}" "N" ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
output_msg ${INF_CREATING} # $SERVICENAME $PREFIX$SERVICENAME
|
||||||
|
|
||||||
|
rm -f $PREFIX$SERVICENAME
|
||||||
|
|
||||||
|
# write service header
|
||||||
|
echoconfiginfo
|
||||||
|
|
||||||
|
echo "#" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# Set up SQL Anywhere environment (PATH, LIBPATH, etc.)" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "#" >>$PREFIX$SERVICENAME;
|
||||||
|
echo ". $SQLANYDIR/$BIN/sa_config.sh >/dev/null 2>&1" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "" >>$PREFIX$SERVICENAME;
|
||||||
|
|
||||||
|
echo "#" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# Set up script variables" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "#" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "unset SATMP" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "[ -z \"\$TMP\" ] && TMP=/tmp/.SQLAnywhere" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "ACCOUNT=$ACCOUNT" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "BIN=$BIN" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "BITNESS=$BITNESS" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "DBSVC_TYPE=$DBSVC_TYPE" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "INPUTCMD=\"dbsvc $INPUTCMD\"">>$PREFIX$SERVICENAME
|
||||||
|
echo "PIDFILE=$PIDFILE" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "PRIORITY=$PRIORITY" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "RUNLEVEL=$RUNLEVEL" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "SERVICENAME=$SERVICENAME" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "SQLANYDIR=$SQLANYDIR" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "STARTUP=$STARTUP" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "SVC_TOOL_CMDLINE=\"$SVC_TOOL_CMDLINE\" " >>$PREFIX$SERVICENAME;
|
||||||
|
echo "ODBCINI=$ODINI" >>$PREFIX$SERVICENAME;
|
||||||
|
|
||||||
|
if svc_t_has_servername; then
|
||||||
|
echo "SERVERNAME=$SERVERNAME">>$PREFIX$SERVICENAME
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "#" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "# get implementation of start/stop/status/restart from dbsvc" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "#" >>$PREFIX$SERVICENAME;
|
||||||
|
echo "" >>$PREFIX$SERVICENAME;
|
||||||
|
echo ". $SQLANYDIR/$BIN/dbsvc RUNSERVICECMD \$*" >>$PREFIX$SERVICENAME;
|
||||||
|
chmod 755 $PREFIX$SERVICENAME
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve_pidfilen()
|
||||||
|
##################
|
||||||
|
{
|
||||||
|
# compute pid file name to be used based on defined PIDFILE value
|
||||||
|
if [ "$PIDFILE" = ".use.default." ]; then
|
||||||
|
PIDFILEN=/var/run/${SVCNAME_PFX}${SERVICENAME}.pid
|
||||||
|
else
|
||||||
|
PIDFILEN=$PIDFILE
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
parse_cl_options_utility()
|
||||||
|
##########################
|
||||||
|
{
|
||||||
|
if [ "F$1" = "F-?" ]; then
|
||||||
|
usage $1
|
||||||
|
fi
|
||||||
|
PIDFILE=.use.default.
|
||||||
|
INPUTCMD=$*
|
||||||
|
DONE=0
|
||||||
|
while [ $DONE -eq 0 ] && [ ! -z "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
#
|
||||||
|
# Modifier options
|
||||||
|
#
|
||||||
|
|
||||||
|
# quiet mode
|
||||||
|
-q | -quiet )
|
||||||
|
QUIET=1
|
||||||
|
;;
|
||||||
|
# display creation command
|
||||||
|
-cm )
|
||||||
|
LISTCMD=TRUE
|
||||||
|
;;
|
||||||
|
# automatically answer "yes" to overwrites/delete
|
||||||
|
-y )
|
||||||
|
AUTOYES=1
|
||||||
|
;;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Major options
|
||||||
|
#
|
||||||
|
|
||||||
|
# delete service
|
||||||
|
-delete | -d )
|
||||||
|
shift
|
||||||
|
SERVICENAME=$1
|
||||||
|
ACTION=deleteservice
|
||||||
|
DONE=1
|
||||||
|
|
||||||
|
# validation
|
||||||
|
if [ ! -w "${SVCDIR}" ]; then
|
||||||
|
output_fatal_error "${ERR_PERMMOD}"
|
||||||
|
fi
|
||||||
|
if [ "$SERVICENAME" = "" ]; then
|
||||||
|
output_usage_error "${ERR_NOSERVICENAME}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
# print details on a service
|
||||||
|
-details | -g )
|
||||||
|
shift
|
||||||
|
SERVICENAME=$1
|
||||||
|
ACTION=detailservice
|
||||||
|
DONE=1
|
||||||
|
|
||||||
|
# validation
|
||||||
|
if [ "$SERVICENAME" = "" ]; then
|
||||||
|
output_usage_error "${ERR_NOSERVICENAME}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
# directory of services
|
||||||
|
-list | -l )
|
||||||
|
ACTION=listservices
|
||||||
|
;;
|
||||||
|
|
||||||
|
# create a service
|
||||||
|
-w | -write )
|
||||||
|
shift
|
||||||
|
SERVICENAME=$1
|
||||||
|
ACTION=createservice
|
||||||
|
DONE=1
|
||||||
|
|
||||||
|
# validation
|
||||||
|
if [ "$SERVICENAME" = "" ]; then
|
||||||
|
output_usage_error "${ERR_NOSERVICENAME}"
|
||||||
|
fi
|
||||||
|
if [ "$ACCOUNT" = "" ]; then
|
||||||
|
output_usage_error "${ERR_NOACCOUNT}"
|
||||||
|
fi
|
||||||
|
if [ ! -w "${SVCDIR}" ]; then
|
||||||
|
output_fatal_error "${ERR_PERMMOD}"
|
||||||
|
fi
|
||||||
|
CHKDSH=`echo F$SERVICENAME | grep "F-"`
|
||||||
|
if [ "$CHKDSH" != "" ]; then
|
||||||
|
output_msg "${INF_WARNSVCWITHDASH}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
shift
|
||||||
|
SVC_DETAILS=$*
|
||||||
|
;;
|
||||||
|
|
||||||
|
#Start SQL Anywhere Service
|
||||||
|
-u | -start)
|
||||||
|
shift
|
||||||
|
SERVICENAME=$1
|
||||||
|
ACTION=startservice
|
||||||
|
DONE=1
|
||||||
|
|
||||||
|
# validation
|
||||||
|
[ ! -w "${SVCDIR}" ] && output_fatal_error "${ERR_PERMMOD}"
|
||||||
|
[ -z "$SERVICENAME" ] && output_usage_error "${ERR_NOSERVICENAME}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
# Stop SQL Anywhere Service
|
||||||
|
-x | -stop )
|
||||||
|
shift
|
||||||
|
SERVICENAME=$1
|
||||||
|
ACTION=stopservice
|
||||||
|
DONE=1
|
||||||
|
|
||||||
|
# validation
|
||||||
|
[ ! -w "${SVCDIR}" ] && output_fatal_error "${ERR_PERMMOD}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
# status of Service
|
||||||
|
-status )
|
||||||
|
shift
|
||||||
|
SERVICENAME=$1
|
||||||
|
ACTION=statusservice
|
||||||
|
DONE=1
|
||||||
|
|
||||||
|
# validation
|
||||||
|
[ -z "$SERVICENAME" ] && output_usage_error "${ERR_NOSERVICENAME}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
# disable service
|
||||||
|
-disable )
|
||||||
|
shift
|
||||||
|
SERVICENAME=$1
|
||||||
|
ACTION=disableservice
|
||||||
|
DONE=1
|
||||||
|
|
||||||
|
# validation
|
||||||
|
[ -z "$SERVICENAME" ] && output_usage_error "${ERR_NOSERVICENAME}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
# enable service
|
||||||
|
-enable )
|
||||||
|
shift
|
||||||
|
SERVICENAME=$1
|
||||||
|
ACTION=enableservice
|
||||||
|
DONE=1
|
||||||
|
|
||||||
|
# validation
|
||||||
|
[ -z "$SERVICENAME" ] && output_usage_error "${ERR_NOSERVICENAME}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Creation options
|
||||||
|
#
|
||||||
|
|
||||||
|
# local daemon account
|
||||||
|
-as )
|
||||||
|
ACCOUNT="daemon"
|
||||||
|
;;
|
||||||
|
|
||||||
|
# Run service as user account
|
||||||
|
-a | -account )
|
||||||
|
shift
|
||||||
|
ACCOUNT=$1
|
||||||
|
|
||||||
|
# validation
|
||||||
|
CHKUSER=`awk -F : '{ print $1 }' /etc/passwd | grep $ACCOUNT`
|
||||||
|
[ -z "$CHKUSER" ] && output_msg "${INF_NOUSER}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
# Startup Type "Disabled does not make sense here"
|
||||||
|
# Currently not documented but is in the usage message
|
||||||
|
-startup | -s )
|
||||||
|
shift
|
||||||
|
case `tolower $1` in
|
||||||
|
auto | automatic )
|
||||||
|
STARTUP="Automatic"
|
||||||
|
;;
|
||||||
|
man | manual )
|
||||||
|
STARTUP="Manual"
|
||||||
|
RUNLEVEL=""
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
output_usage_error "${ERR_INVALIDSTARTUP}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
|
||||||
|
# Type could be one of the following:
|
||||||
|
# Network, Personal, DBRemote, MobiLink, DBMLSync
|
||||||
|
-t | -type )
|
||||||
|
shift
|
||||||
|
case `tolower $1` in
|
||||||
|
personal | standalone | dbeng )
|
||||||
|
DBSVC_TYPE="Personal"
|
||||||
|
;;
|
||||||
|
network | dbsrv )
|
||||||
|
DBSVC_TYPE="Network"
|
||||||
|
;;
|
||||||
|
mobilink | mlsrv )
|
||||||
|
DBSVC_TYPE="MobiLink"
|
||||||
|
;;
|
||||||
|
dbmlsync | mlsync )
|
||||||
|
DBSVC_TYPE="DBMLsync"
|
||||||
|
;;
|
||||||
|
dbremote )
|
||||||
|
DBSVC_TYPE="DBRemote"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ -r "${DBSVC_DIR}/dbsvc_scripts/svc_t_`tolower $1`" ] && [ "$1" != "common" ]; then
|
||||||
|
DBSVC_TYPE="$1"
|
||||||
|
else
|
||||||
|
output_usage_error "${ERR_INVALIDTYPE}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Linux-specific options
|
||||||
|
#
|
||||||
|
|
||||||
|
#Set nice priority of service
|
||||||
|
-pr | -priority )
|
||||||
|
shift
|
||||||
|
PRIORITY=$1
|
||||||
|
;;
|
||||||
|
|
||||||
|
#ODBCINI specification
|
||||||
|
-od | -odbcini )
|
||||||
|
shift
|
||||||
|
ODINI=$1
|
||||||
|
;;
|
||||||
|
|
||||||
|
# Specify run level for service upon start up.
|
||||||
|
-rl | -runlevel )
|
||||||
|
shift
|
||||||
|
RUNLEVEL=$1
|
||||||
|
;;
|
||||||
|
|
||||||
|
# Groups may not make sense here daemon does not seem to support it.
|
||||||
|
# set dependencies
|
||||||
|
# "$DEP_SERVICES" is echoed out in the Required-Start line
|
||||||
|
# NOTE: must specify 1 dependent service per -rs switch (not a list)
|
||||||
|
-rs )
|
||||||
|
shift
|
||||||
|
DEP_SERVICE=$1
|
||||||
|
|
||||||
|
# validation
|
||||||
|
[ -z "$DEP_SERVICE" ] && output_usage_error "${ERR_NOSERVICENAME}"
|
||||||
|
if [ ! -r "$SVCDIR/$DEPSVC" ]; then
|
||||||
|
local TDEPSVC=$PREFIX$DEPSVC
|
||||||
|
if [ ! -r "$SVCDIR/$TDEPSVC" ]; then
|
||||||
|
output_msg "${INF_WARNINGDEPENDENT}"
|
||||||
|
else
|
||||||
|
DEP_SERVICE=$TDEPSVC
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# old way to check for dependent service
|
||||||
|
# CWD=`pwd`
|
||||||
|
# cd $SVCDIR
|
||||||
|
# FIND_DEPSVC=`grep "#" $DEP_SERVICE`
|
||||||
|
# [ -z "$FIND_DEPSVC" ] && output_msg "${INF_WARNINGDEPENDENT}"
|
||||||
|
# cd $CWD
|
||||||
|
|
||||||
|
# put a '$' before (looks like each) service name
|
||||||
|
# "$" before a service name refers to a group of services that comprise the pseudo name. These are defined in /etc/insserv.conf.
|
||||||
|
# See http://www.novell.com/support/kb/doc.php?id=7002295
|
||||||
|
DEP_SERVICE="\$"`echo $DEP_SERVICE`
|
||||||
|
DEP_SERVICES=`echo $DEP_SERVICES $DEP_SERVICE | sed 's@ @\n@g' | sort | uniq`
|
||||||
|
DEP_SERVICES=`echo $DEP_SERVICES`
|
||||||
|
;;
|
||||||
|
|
||||||
|
# pidfile specification
|
||||||
|
-pf | -pidfile )
|
||||||
|
PIDFILE=.use.default.
|
||||||
|
;;
|
||||||
|
|
||||||
|
-pfn | -pidfilename )
|
||||||
|
shift
|
||||||
|
PIDFILE=$1
|
||||||
|
;;
|
||||||
|
|
||||||
|
-pf- | -pidfile- )
|
||||||
|
PIDFILE=
|
||||||
|
;;
|
||||||
|
|
||||||
|
# All else is an error
|
||||||
|
* )
|
||||||
|
echo "${ERR_UNRECOGNIZED_OPTION}" $1
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
shift
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
# some validation of ODINI here, now that we know $ACCOUNT too
|
||||||
|
if [ "$ACTION" = "createservice" ]; then
|
||||||
|
# check if they specified a DSN
|
||||||
|
local hasDSN=`echo $INPUTCMD | grep -i dsn=`
|
||||||
|
if [ "$hasDSN" != "" ]; then
|
||||||
|
if [ -z "$ODINI" ]; then
|
||||||
|
ODINI=`grep -e ^$ACCOUNT /etc/passwd | awk -F : '{print $6"/.odbc.ini"}'`
|
||||||
|
fi
|
||||||
|
[ ! -r "$ODINI" ] && output_msg "${INF_NOODBCINIEXIST}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
resolve_pidfilen
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# mainline
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
# Determine whether we are being called from a service script ("svc" mode)
|
||||||
|
# or whether we are being run to manage services ("utility" mode)
|
||||||
|
init
|
||||||
|
if [ "$1" = "RUNSERVICECMD" ]; then
|
||||||
|
MODE=svc
|
||||||
|
shift
|
||||||
|
resolve_pidfilen
|
||||||
|
else
|
||||||
|
MODE=utility
|
||||||
|
fi
|
||||||
|
init_${MODE}
|
||||||
|
|
||||||
|
# validate that we found the SQLANYDIR; otherwise, we can't load our language
|
||||||
|
# resources, scripts, etc.
|
||||||
|
if [ -z "$SQLANYDIR" ]; then
|
||||||
|
echo "Error: SQL Anywhere environment \$SQLANY16 not set."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
. "${DBSVC_DIR}/dbsvc_scripts/distro.sh"
|
||||||
|
. "${DBSVC_DIR}/dbsvc_scripts/utility.sh"
|
||||||
|
. "${DBSVC_DIR}/dbsvc_scripts/dbsvc_iface"
|
||||||
|
. "${DBSVC_DIR}/dbsvc_scripts/svc_t_common"
|
||||||
|
. "${DBSVC_DIR}/dbsvc_scripts/svc_functions"
|
||||||
|
|
||||||
|
load_language_file
|
||||||
|
check_os_requirements # test that service functions are available
|
||||||
|
check_tool_requirements # sed, grep, awk, tr, tail, etc.
|
||||||
|
|
||||||
|
# Pull in the LSB init functions
|
||||||
|
. $INIT_FUNCS
|
||||||
|
|
||||||
|
# This call will figure out which service interface we are using with the OS (lsb, rh, suse)
|
||||||
|
# can override by passing a parameter lsb|rh|suse
|
||||||
|
dbsvc_iface_init
|
||||||
|
|
||||||
|
# The following sets the following global variables:
|
||||||
|
# * means that they are written out to the service script as well
|
||||||
|
# *ACCOUNT (daemon, or user account)
|
||||||
|
# *DBSVC_TYPE (Personal, Network, etc...)
|
||||||
|
# *INPUTCMD (original cmd line sent to dbsvc)
|
||||||
|
# *PIDFILE (full pathname to pidfile if requested, empty otherwise)
|
||||||
|
# *ODINI (ODBCINI specification)
|
||||||
|
# *PRIORITY (nice priority of service)
|
||||||
|
# *RUNLEVEL (Specify run level for service upon start up)
|
||||||
|
# *SERVICENAME (name of service being operated on)
|
||||||
|
# *STARTUP (Manual|Automatic)
|
||||||
|
# ACTION (action to take)
|
||||||
|
# DEP_SERVICES (echoed out in the Required-Start line)
|
||||||
|
# LISTCMD (display creation command TRUE|FALSE)
|
||||||
|
# AUTOYES (pre-confirm overwrite/delete 1|0)
|
||||||
|
# QUIET (quiet mode 1|0)
|
||||||
|
# SVC_DETAILS (when creating a service, the command line to be passed to the tool)
|
||||||
|
#
|
||||||
|
# Note that the following are written out to the service script as well
|
||||||
|
# *SVC_TOOL_CMDLINE
|
||||||
|
# *SERVERNAME (if applicable)
|
||||||
|
# *SQLANYDIR
|
||||||
|
# *ODBCINI (exported)
|
||||||
|
|
||||||
|
parse_cl_options_${MODE} $*
|
||||||
|
|
||||||
|
# some validation here
|
||||||
|
[ -z "$ACTION" ] && output_usage_error "${INF_NOACTION}"
|
||||||
|
|
||||||
|
# get interface to tool based on DBSVC_TYPE, and initialize it
|
||||||
|
svc_t_iface_init ${DBSVC_TYPE}
|
||||||
|
|
||||||
|
if [ "$MODE" = "utility" ] && [ "$ACTION" = "createservice" ]; then
|
||||||
|
# Warn if the tool is not found
|
||||||
|
svc_t_checkbinary
|
||||||
|
|
||||||
|
# give a hook for the tools to modify their cmdline at creation time
|
||||||
|
# (eg. for SA, add -ud if not there)
|
||||||
|
SVC_TOOL_CMDLINE=`svc_t_process_cmdline $SVC_DETAILS` ## from svc_t_<tool> script above
|
||||||
|
|
||||||
|
# some tools have the concept of a server name - if so set $SERVERNAME
|
||||||
|
if svc_t_has_servername; then
|
||||||
|
SERVERNAME=`svc_t_process_servername $SVC_DETAILS`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# call the appropriate function to do the work
|
||||||
|
$ACTION
|
||||||
|
|
||||||
|
|
@ -0,0 +1,135 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
START_DAEMON=start_daemon
|
||||||
|
KILLPROC=killproc
|
||||||
|
PIDOFPROC=pidofproc
|
||||||
|
LOG_SUCCESS_MSG=log_success_msg
|
||||||
|
LOG_FAILURE_MSG=log_failure_msg
|
||||||
|
LOG_WARNING_MSG=log_warning_msg
|
||||||
|
|
||||||
|
dbsvc_iface_getiface()
|
||||||
|
######################
|
||||||
|
# We rely on lsb; the others are placeholders that are currently unused
|
||||||
|
{
|
||||||
|
if [ -r "/lib/lsb/init-functions" ]; then
|
||||||
|
echo "lsb"
|
||||||
|
elif [ -r "/etc/rc.status" ]; then
|
||||||
|
echo "suse"
|
||||||
|
elif [ -r "/etc/init.d/functions" ]; then
|
||||||
|
echo "rh"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
dbsvc_iface_init()
|
||||||
|
##################
|
||||||
|
# can pass optional $1 to force lsb|rh|suse
|
||||||
|
{
|
||||||
|
RUNLEVEL="235"
|
||||||
|
[ -z "$PRIORITY" ] && PRIORITY="+00"
|
||||||
|
STARTUP="Manual"
|
||||||
|
SVCDIR=/etc/init.d
|
||||||
|
PREFIX=${SVCDIR}/${SVCNAME_PFX}
|
||||||
|
|
||||||
|
dbsvc_iface_load $1
|
||||||
|
}
|
||||||
|
|
||||||
|
dbsvc_iface_load()
|
||||||
|
##################
|
||||||
|
# Allow $1 to override which interface functions we load
|
||||||
|
{
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
SVC_IFACE=$1
|
||||||
|
else
|
||||||
|
SVC_IFACE=`dbsvc_iface_getiface`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Load common init-functions (only LSB currently used)
|
||||||
|
if [ -r "/lib/lsb/init-functions" ]; then
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
elif [ -r "/etc/rc.status" ]; then
|
||||||
|
. /etc/rc.status
|
||||||
|
elif [ -r "/etc/init.d/functions" ]; then
|
||||||
|
. /etc/init.d/functions
|
||||||
|
fi
|
||||||
|
# Load interface-specific procdures (only LSB currently used)
|
||||||
|
if [ -r "${DBSVC_DIR}/dbsvc_scripts/dbsvc_iface_${SVC_IFACE}" ]; then
|
||||||
|
. "${DBSVC_DIR}/dbsvc_scripts/dbsvc_iface_${SVC_IFACE}"
|
||||||
|
dbsvc_iface_init_${SVC_IFACE}
|
||||||
|
fi
|
||||||
|
# Need to override aliases on RedHat
|
||||||
|
if is_redhat || is_redflag ; then
|
||||||
|
. "${DBSVC_DIR}/dbsvc_scripts/dbsvc_iface_rh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check whether we have chkconfig or update-rc.d for installing services
|
||||||
|
HAS_CHKCONFIG=0
|
||||||
|
HAS_UPDATE_RC=0
|
||||||
|
|
||||||
|
CHKCONFIG_BIN=/sbin/chkconfig
|
||||||
|
if [ -r $CHKCONFIG_BIN ]; then
|
||||||
|
HAS_CHKCONFIG=1
|
||||||
|
else
|
||||||
|
# Try PATH
|
||||||
|
CHKCONFIG_BIN=`/bin/which chkconfig 2>/dev/null`
|
||||||
|
if [ -n $CHKCONFIG_BIN ] && [ -r "$CHKCONFIG_BIN" ]; then
|
||||||
|
HAS_CHKCONFIG=1
|
||||||
|
else
|
||||||
|
CHKCONFIG_BIN=""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
UPDATE_RC_BIN=/usr/sbin/update-rc.d
|
||||||
|
if [ -r "$UPDATE_RC_BIN" ]; then
|
||||||
|
HAS_UPDATE_RC=1
|
||||||
|
else
|
||||||
|
# Try PATH
|
||||||
|
UPDATE_RC_BIN=`/bin/which update-rc.d 2>/dev/null`
|
||||||
|
if [ -n $UPDATE_RC_BIN ] && [ -r "$UPDATE_RC_BIN" ]; then
|
||||||
|
HAS_UPDATE_RC=1
|
||||||
|
else
|
||||||
|
UPDATE_RC_BIN=""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
dbsvc_iface_installsvc()
|
||||||
|
########################
|
||||||
|
{
|
||||||
|
if [ ${HAS_CHKCONFIG:-0} -ne 0 ]; then
|
||||||
|
$CHKCONFIG_BIN --add $SVCNAME_PFX$SERVICENAME > /dev/null
|
||||||
|
$CHKCONFIG_BIN --level $RUNLEVEL $SVCNAME_PFX$SERVICENAME on > /dev/null
|
||||||
|
elif [ ${HAS_UPDATE_RC:-0} -ne 0 ]; then
|
||||||
|
$UPDATE_RC_BIN $SVCNAME_PFX$SERVICENAME start 60 $RUNLEVELS . stop 80 $STOPLEVELS .
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dbsvc_iface_uninstallsvc()
|
||||||
|
##########################
|
||||||
|
{
|
||||||
|
if [ ${HAS_CHKCONFIG:-0} -ne 0 ]; then
|
||||||
|
$CHKCONFIG_BIN $SVCNAME_PFX$SERVICENAME off > /dev/null
|
||||||
|
$CHKCONFIG_BIN --del $SVCNAME_PFX$SERVICENAME > /dev/null
|
||||||
|
elif [ ${HAS_UPDATE_RC:-0} -ne 0 ]; then
|
||||||
|
$UPDATE_RC_BIN -f $SVCNAME_PFX$SERVICENAME remove
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
dbsvc_iface_checkdeletedsvc()
|
||||||
|
#############################
|
||||||
|
{
|
||||||
|
if [ ${HAS_CHKCONFIG:-0} -ne 0 ]; then
|
||||||
|
ISTHERE=`$CHKCONFIG_BIN --list | grep $SVCNAME_PFX$SERVICENAME`
|
||||||
|
if [ -r $SVCNAME_PFX$SERVICENAME ] || [ "$ISTHERE" != "" ]; then
|
||||||
|
output_msg "${ERR_NODELETE}" # $SERVICENAME
|
||||||
|
fi
|
||||||
|
elif [ ${HAS_UPDATE_RC:-0} -ne 0 ]; then
|
||||||
|
if [ -r $SVCNAME_PFX$SERVICENAME ]; then
|
||||||
|
output_msg "${ERR_NODELETE}" # $SERVICENAME
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
dbsvc_iface_init_lsb()
|
||||||
|
######################
|
||||||
|
{
|
||||||
|
RUNLEVEL="235"
|
||||||
|
[ -z "$PRIORITY" ] && PRIORITY="+00"
|
||||||
|
STARTUP="Manual"
|
||||||
|
SVCDIR=/etc/init.d
|
||||||
|
PREFIX=${SVCDIR}/${SVCNAME_PFX}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
dbsvc_iface_init_rh()
|
||||||
|
#####################
|
||||||
|
{
|
||||||
|
RUNLEVEL="35"
|
||||||
|
[ -z "$PRIORITY" ] && PRIORITY="+00"
|
||||||
|
STARTUP="Manual"
|
||||||
|
SVCDIR=/etc/init.d
|
||||||
|
PREFIX=${SVCDIR}/${SVCNAME_PFX}
|
||||||
|
}
|
||||||
|
|
||||||
|
unalias start_daemon 2>/dev/null
|
||||||
|
start_daemon () {
|
||||||
|
local lsb_prefix
|
||||||
|
[ -r /etc/asianux-lsb ] && lsb_prefix=/etc/asianux-lsb
|
||||||
|
[ -r /etc/redhat-lsb ] && lsb_prefix=/etc/redhat-lsb
|
||||||
|
$lsb_prefix/lsb_start_daemon "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
unalias killproc 2>/dev/null
|
||||||
|
killproc () {
|
||||||
|
local lsb_prefix
|
||||||
|
[ -r /etc/asianux-lsb ] && lsb_prefix=/etc/asianux-lsb
|
||||||
|
[ -r /etc/redhat-lsb ] && lsb_prefix=/etc/redhat-lsb
|
||||||
|
$lsb_prefix/lsb_killproc "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
unalias pidofproc 2>/dev/null
|
||||||
|
pidofproc () {
|
||||||
|
local lsb_prefix
|
||||||
|
[ -r /etc/asianux-lsb ] && lsb_prefix=/etc/asianux-lsb
|
||||||
|
[ -r /etc/redhat-lsb ] && lsb_prefix=/etc/redhat-lsb
|
||||||
|
$lsb_prefix/lsb_pidofproc "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
unalias log_success_msg 2>/dev/null
|
||||||
|
log_success_msg () {
|
||||||
|
local lsb_prefix
|
||||||
|
[ -r /etc/asianux-lsb ] && lsb_prefix=/etc/asianux-lsb
|
||||||
|
[ -r /etc/redhat-lsb ] && lsb_prefix=/etc/redhat-lsb
|
||||||
|
$lsb_prefix/lsb_log_message success "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
unalias log_failure_msg 2>/dev/null
|
||||||
|
log_failure_msg () {
|
||||||
|
local lsb_prefix
|
||||||
|
[ -r /etc/asianux-lsb ] && lsb_prefix=/etc/asianux-lsb
|
||||||
|
[ -r /etc/redhat-lsb ] && lsb_prefix=/etc/redhat-lsb
|
||||||
|
$lsb_prefix/lsb_log_message failure "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
unalias log_warning_msg 2>/dev/null
|
||||||
|
log_warning_msg () {
|
||||||
|
local lsb_prefix
|
||||||
|
[ -r /etc/asianux-lsb ] && lsb_prefix=/etc/asianux-lsb
|
||||||
|
[ -r /etc/redhat-lsb ] && lsb_prefix=/etc/redhat-lsb
|
||||||
|
$lsb_prefix/lsb_log_message warning "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
dbsvc_iface_init_suse()
|
||||||
|
#######################
|
||||||
|
{
|
||||||
|
RUNLEVEL="35"
|
||||||
|
[ -z "$PRIORITY" ] && PRIORITY="+00"
|
||||||
|
STARTUP="Manual"
|
||||||
|
SVCDIR=/etc/init.d
|
||||||
|
PREFIX=${SVCDIR}/${SVCNAME_PFX}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
# ***************************************************************************
|
||||||
|
# Copyright (c) 2013 SAP AG or an SAP affiliate company. All rights reserved.
|
||||||
|
# ***************************************************************************
|
||||||
|
is_redflag()
|
||||||
|
############
|
||||||
|
{
|
||||||
|
if [ `plat_os` = "linux" ] ; then
|
||||||
|
grep -q -s "Red Flag" /etc/issue >/dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
false
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
is_redhat()
|
||||||
|
###########
|
||||||
|
{
|
||||||
|
if [ `plat_os` = "linux" ] ; then
|
||||||
|
grep -q -s "Red Hat" /etc/issue >/dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
false
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
is_suse()
|
||||||
|
#########
|
||||||
|
{
|
||||||
|
if [ `plat_os` = "linux" ] ; then
|
||||||
|
grep -q -s -i "SuSE" /etc/issue >/dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
false
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
is_ubuntu()
|
||||||
|
###########
|
||||||
|
{
|
||||||
|
if [ `plat_os` = "linux" ] ; then
|
||||||
|
grep -q -s -i "Ubuntu" /etc/issue >/dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
false
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
plat_os()
|
||||||
|
#########
|
||||||
|
{
|
||||||
|
case "`uname -s`" in
|
||||||
|
Linux)
|
||||||
|
echo "linux"
|
||||||
|
;;
|
||||||
|
AIX)
|
||||||
|
echo "aix"
|
||||||
|
;;
|
||||||
|
HP-UX)
|
||||||
|
echo "hpux"
|
||||||
|
;;
|
||||||
|
Darwin)
|
||||||
|
echo "macos"
|
||||||
|
;;
|
||||||
|
SunOS)
|
||||||
|
echo "solaris"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,181 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
#
|
||||||
|
# provide boiler-plate start/stop/status/restart for the generated service script
|
||||||
|
# all required vars should be set in script
|
||||||
|
#
|
||||||
|
|
||||||
|
parse_cl_options_svc()
|
||||||
|
######################
|
||||||
|
{
|
||||||
|
case "$1" in
|
||||||
|
start | stop | restart )
|
||||||
|
ACTION=$1
|
||||||
|
;;
|
||||||
|
status )
|
||||||
|
ACTION=sa_status
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
echo "${INF_USAGE}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Implementation of start, stop, status, restart
|
||||||
|
#
|
||||||
|
|
||||||
|
start()
|
||||||
|
#######
|
||||||
|
{
|
||||||
|
local cmd="`svc_t_toolspath` ${SVC_TOOL_CMDLINE}"
|
||||||
|
local status=`svc_t_status`
|
||||||
|
local sd_cmd=$START_DAEMON
|
||||||
|
local pr_num=${PRIORITY##[-+]}
|
||||||
|
local pr_sign=${PRIORITY%%[0-9]*}
|
||||||
|
|
||||||
|
[ -z $pr_sign ] && pr_sign="+"
|
||||||
|
|
||||||
|
if [ $status -eq 0 ]; then
|
||||||
|
$LOG_WARNING_MSG "${INF_ALREADYRUNNING}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "${INF_STARTING}"
|
||||||
|
|
||||||
|
if is_redhat; then
|
||||||
|
export NICELEVEL="$PRIORITY"
|
||||||
|
if [ "$ACCOUNT" != "daemon" ]; then
|
||||||
|
. /etc/init.d/functions
|
||||||
|
sd_cmd="daemon --user $ACCOUNT"
|
||||||
|
fi
|
||||||
|
$sd_cmd $cmd
|
||||||
|
elif is_suse; then
|
||||||
|
# leading -/+ required
|
||||||
|
local pr=${pr_sign}${pr_num}
|
||||||
|
# Can't use "bin32s" wrapper with startproc
|
||||||
|
cmd="`svc_t_toolpath` ${SVC_TOOL_CMDLINE}"
|
||||||
|
|
||||||
|
if [ "$ACCOUNT" != "daemon" ]; then
|
||||||
|
sd_cmd="$sd_cmd -n $pr -u $ACCOUNT"
|
||||||
|
else
|
||||||
|
sd_cmd="$sd_cmd -n $pr"
|
||||||
|
fi
|
||||||
|
$sd_cmd $cmd
|
||||||
|
elif is_ubuntu; then
|
||||||
|
local nice_cmd=""
|
||||||
|
if [ "$ACCOUNT" != "daemon" ]; then
|
||||||
|
sd_cmd="sudo -u $ACCOUNT"
|
||||||
|
$sd_cmd $cmd
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
sudo renice $PRIORITY `svc_t_getpid` 2>&1 >/dev/null
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# prepend nice command if necessary
|
||||||
|
if [ `eval expr "$pr_num + 0"` != 0 ]; then
|
||||||
|
nice_cmd="-n $PRIORITY"
|
||||||
|
fi
|
||||||
|
$sd_cmd $nice_cmd $cmd
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# this case will get used for RedFlag
|
||||||
|
local nice_cmd=""
|
||||||
|
if [ "$ACCOUNT" != "daemon" ]; then
|
||||||
|
sd_cmd="su $ACCOUNT -c"
|
||||||
|
else
|
||||||
|
sd_cmd="su -c"
|
||||||
|
fi
|
||||||
|
# prepend nice command if necessary
|
||||||
|
if [ `eval expr "$pr_num + 0"` != 0 ]; then
|
||||||
|
nice_cmd="nice -n $PRIORITY"
|
||||||
|
fi
|
||||||
|
$sd_cmd "$nice_cmd $cmd"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if we really started; in some cases the tool will be successfully launched,
|
||||||
|
# but an error will occur on startup. On RedHat, "runuser" swallows the return
|
||||||
|
# code in this case. Work around this my checking status after starting.
|
||||||
|
# This also help customers who have inadvertently given an incorrect command line,
|
||||||
|
# since when starting the service they will not see any error messages in the
|
||||||
|
# terminal.
|
||||||
|
local retcode=$?
|
||||||
|
status=`svc_t_status`
|
||||||
|
[ $status -ne 0 ] && retcode=$status
|
||||||
|
|
||||||
|
if [ $retcode -eq 0 ]; then
|
||||||
|
$LOG_SUCCESS_MSG
|
||||||
|
if [ "$PIDFILEN" != "" ]; then
|
||||||
|
# record the pid of the process that we just started
|
||||||
|
sudo echo `svc_t_getpid` >$PIDFILEN 2>/dev/null
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
$LOG_FAILURE_MSG
|
||||||
|
if [ "$PIDFILEN" != "" ]; then
|
||||||
|
# if there was a pid file, get rid of it
|
||||||
|
if [ -f "$PIDFILEN" ]; then
|
||||||
|
sudo rm -f $PIDFILEN 2>/dev/null
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
} # start
|
||||||
|
|
||||||
|
stop()
|
||||||
|
######
|
||||||
|
{
|
||||||
|
local status=`svc_t_status`
|
||||||
|
|
||||||
|
if [ $status -ne 0 ]; then
|
||||||
|
$LOG_WARNING_MSG "${INF_NOTRUNNING}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "${INF_STOPPING}"
|
||||||
|
if [ "$PIDFILEN" != "" ]; then
|
||||||
|
# if there was a pid file, get rid of it
|
||||||
|
if [ -f "$PIDFILEN" ]; then
|
||||||
|
sudo rm -f $PIDFILEN 2>/dev/null
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
svc_t_stopcmd
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
$LOG_SUCCESS_MSG
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
$LOG_FAILURE_MSG
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
} # stop
|
||||||
|
|
||||||
|
sa_status()
|
||||||
|
###########
|
||||||
|
{
|
||||||
|
local status=`svc_t_status`
|
||||||
|
|
||||||
|
if [ $status -ne 0 ]; then
|
||||||
|
$LOG_WARNING_MSG "${INF_CHECKING_NF}"
|
||||||
|
if [ "$PIDFILEN" != "" ]; then
|
||||||
|
# if there was a pid file, get rid of it
|
||||||
|
if [ -f "$PIDFILEN" ]; then
|
||||||
|
sudo rm -f $PIDFILEN 2>/dev/null
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
$LOG_SUCCESS_MSG "${INF_CHECKING_OK}"
|
||||||
|
fi
|
||||||
|
return $status
|
||||||
|
} # sa_status
|
||||||
|
|
||||||
|
restart()
|
||||||
|
#########
|
||||||
|
{
|
||||||
|
stop
|
||||||
|
sleep 5
|
||||||
|
start
|
||||||
|
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,148 @@
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
svc_t_iface_load()
|
||||||
|
##################
|
||||||
|
# get interface to tool
|
||||||
|
# Allow $1 to fall back on global variable DBSVC_TYPE
|
||||||
|
{
|
||||||
|
local svc_tool_iface
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
svc_tool_iface=`tolower $1`
|
||||||
|
else
|
||||||
|
svc_tool_iface=`tolower ${DBSVC_TYPE}`
|
||||||
|
fi
|
||||||
|
. "${DBSVC_DIR}/dbsvc_scripts/svc_t_${svc_tool_iface}"
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_iface_init()
|
||||||
|
##################
|
||||||
|
# $1 : DBSVC_TYPE
|
||||||
|
{
|
||||||
|
svc_t_iface_load $1
|
||||||
|
svc_t_init
|
||||||
|
}
|
||||||
|
|
||||||
|
# Multiple instances of our tools may be running as services.
|
||||||
|
# Need to take into account the command line given to each tool,
|
||||||
|
# to find the right one.
|
||||||
|
# The following finds the pid of the process with the command line that
|
||||||
|
# matches the one we are looking for.
|
||||||
|
# Returns:
|
||||||
|
# sets PROCID and echoes back the pid of the process
|
||||||
|
svc_t_getpid()
|
||||||
|
##############
|
||||||
|
{
|
||||||
|
# get our command line and "hash" it into something that
|
||||||
|
# matches the format of the commandline in /proc/<pid>/cmdline,
|
||||||
|
# with grep-unfriendly characters removed
|
||||||
|
local pcmdline
|
||||||
|
local CMD=`svc_t_toolname`
|
||||||
|
local TCMD=`echo "$SVC_TOOL_CMDLINE" | sed 's/ /\x00/g' | sed 's/-//g' | sed 's/\"//g'`
|
||||||
|
local pid=$PROCID
|
||||||
|
PROCID=
|
||||||
|
if [ ! -z "$pid" ]; then
|
||||||
|
# maybe we're here a second time ... check last time's PID
|
||||||
|
PRFILE="/proc/"$pid"/cmdline"
|
||||||
|
if [ -r $PRFILE ]; then
|
||||||
|
pcmdline=`cat $PRFILE | sed 's/-//g' | sed 's/ //g' `
|
||||||
|
RET=`echo $pcmdline | grep -v dbsvc | grep -v '/etc/init.d/SA_' | grep $TCMD 2>/dev/null`
|
||||||
|
if [ "$RET" != "" ]; then
|
||||||
|
RET=`grep $CMD $PRFILE`
|
||||||
|
if [ "$RET" != "" ]; then
|
||||||
|
PROCID=$pid
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "$PROCID" = "" ] && [ "$PIDFILEN" != "" ]; then
|
||||||
|
# check the pid specified in the PIDFILE first to see if we have a match
|
||||||
|
if [ -f "$PIDFILEN" ]; then
|
||||||
|
pid=`cat "$PIDFILEN"`
|
||||||
|
PRFILE="/proc/"$pid"/cmdline"
|
||||||
|
if [ -r $PRFILE ]; then
|
||||||
|
pcmdline=`cat $PRFILE | sed 's/-//g' | sed 's/ //g' `
|
||||||
|
RET=`echo $pcmdline | grep -v dbsvc | grep -v '/etc/init.d/SA_' | grep $TCMD 2>/dev/null`
|
||||||
|
if [ "$RET" != "" ]; then
|
||||||
|
RET=`grep $CMD $PRFILE`
|
||||||
|
if [ "$RET" != "" ]; then
|
||||||
|
PROCID=$pid
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "$PROCID" = "" ]; then
|
||||||
|
# need to do it the hard way - check all of the /proc/.../ directories
|
||||||
|
for i in `ls -U -p /proc | grep /`; do
|
||||||
|
PRFILE="/proc/"$i"cmdline"
|
||||||
|
if [ -r $PRFILE ]; then
|
||||||
|
pcmdline=`cat $PRFILE | sed 's/-//g' | sed 's/ //g' `
|
||||||
|
RET=`echo $pcmdline | grep -v dbsvc | grep -v '/etc/init.d/SA_' | grep $TCMD 2>/dev/null`
|
||||||
|
if [ "$RET" != "" ]; then
|
||||||
|
RET=`grep $CMD $PRFILE`
|
||||||
|
if [ "$RET" != "" ]; then
|
||||||
|
PROCID=`echo $i | awk -F "/" '{print $1}'`
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
echo $PROCID
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_cmdline_add_ud()
|
||||||
|
##############################
|
||||||
|
# in: cmdline
|
||||||
|
# out: add -ud if not already there
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=$*
|
||||||
|
|
||||||
|
# add -ud if not there
|
||||||
|
local SAW_UD=0
|
||||||
|
while [ ! -z "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
-ud )
|
||||||
|
SAW_UD=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $SAW_UD -eq 0 ]; then
|
||||||
|
MY_CMDLINE="$MY_CMDLINE -ud"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$MY_CMDLINE"
|
||||||
|
}
|
||||||
|
svc_t_status()
|
||||||
|
##############
|
||||||
|
# Most tools check status by verifying the process is still running
|
||||||
|
{
|
||||||
|
local procid=`svc_t_getpid`
|
||||||
|
|
||||||
|
if [ -z "$procid" ]; then
|
||||||
|
false
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
echo $?
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_stopcmd()
|
||||||
|
###############
|
||||||
|
# Most tools stop by sending a HUP signal
|
||||||
|
{
|
||||||
|
local procid=`svc_t_getpid`
|
||||||
|
[ -n "$procid" ] && kill -HUP ${procid}
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_checkbinary()
|
||||||
|
###################
|
||||||
|
{
|
||||||
|
# some validation
|
||||||
|
[ ! -r `svc_t_toolpath` ] && output_msg "${INF_BINARYNOTFOUND}" # ${DBSVC_TYPE}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
svc_t_init()
|
||||||
|
############
|
||||||
|
{
|
||||||
|
NOOP=NOOP
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolname()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
echo "dbmlsync"
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolspath()
|
||||||
|
#################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
# 's' path is the script or shortcut path for this tool
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/${BIN}s/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolpath()
|
||||||
|
################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/$BIN/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_has_servername()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_need_servername()
|
||||||
|
#################
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_cmdline()
|
||||||
|
#######################
|
||||||
|
# in: cmdline
|
||||||
|
# out: cmdline
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=$*
|
||||||
|
|
||||||
|
# nothing to do
|
||||||
|
|
||||||
|
echo "$MY_CMDLINE"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
svc_t_init()
|
||||||
|
############
|
||||||
|
{
|
||||||
|
NOOP=NOOP
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolname()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
echo "dbns"`get_major_version`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolspath()
|
||||||
|
#################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
# 's' path is the script or shortcut path for this tool
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/${BIN}s/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolpath()
|
||||||
|
################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/$BIN/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_has_servername()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_need_servername()
|
||||||
|
#################
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_cmdline()
|
||||||
|
#######################
|
||||||
|
# in: cmdline
|
||||||
|
# out: add -ud if not already there
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=`svc_t_process_cmdline_add_ud $*`
|
||||||
|
|
||||||
|
echo "$MY_CMDLINE"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
svc_t_init()
|
||||||
|
############
|
||||||
|
{
|
||||||
|
NOOP=NOOP
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolname()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
echo "dbremote"
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolspath()
|
||||||
|
#################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
# 's' path is the script or shortcut path for this tool
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/${BIN}s/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolpath()
|
||||||
|
################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/$BIN/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_has_servername()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_need_servername()
|
||||||
|
#################
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_cmdline()
|
||||||
|
#######################
|
||||||
|
# in: cmdline
|
||||||
|
# out: cmdline
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=$*
|
||||||
|
|
||||||
|
# nothing to do
|
||||||
|
|
||||||
|
echo "$MY_CMDLINE"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,126 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
svc_t_init()
|
||||||
|
############
|
||||||
|
{
|
||||||
|
NOOP=NOOP
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolname()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
echo "mlsrv"`get_major_version`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolspath()
|
||||||
|
#################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
# 's' path is the script or shortcut path for this tool
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/${BIN}s/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolpath()
|
||||||
|
################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/$BIN/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_has_servername()
|
||||||
|
######################
|
||||||
|
{
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_need_servername()
|
||||||
|
#######################
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_get_servername_from_cmdline()
|
||||||
|
###################################
|
||||||
|
{
|
||||||
|
while [ ! -z "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
-zs )
|
||||||
|
echo $2
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_cmdline()
|
||||||
|
#######################
|
||||||
|
# in: cmdline
|
||||||
|
# out: add -zs <default> if -zs servername not already there
|
||||||
|
# out: (global) $SERVERNAME is set
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=`svc_t_process_cmdline_add_ud $*`
|
||||||
|
|
||||||
|
# set server name to "<default>" if one is not specified
|
||||||
|
# TODO: should be able to handle no -zs
|
||||||
|
|
||||||
|
SAW_ZS=0
|
||||||
|
while [ ! -z "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
-zs )
|
||||||
|
SAW_ZS=1
|
||||||
|
SERVERNAME=$2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $SAW_ZS -eq 0 ]; then
|
||||||
|
# name the server (consistent with previous behaviour)
|
||||||
|
SERVERNAME="<default>"
|
||||||
|
MY_CMDLINE="$MY_CMDLINE -zs $SERVERNAME"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# validation: unset SERVERNAME if it looks like another switch
|
||||||
|
if [ -n "$SERVERNAME" ]; then
|
||||||
|
TEST_SN=`echo $SERVERNAME | grep "^-"`
|
||||||
|
[ -n "$TEST_SN" ] && SERVERNAME=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$MY_CMDLINE"
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_servername()
|
||||||
|
##########################
|
||||||
|
# in: cmdline
|
||||||
|
# out: servername
|
||||||
|
# Note: always called after process_commandline above, so there will always be a -zs
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=$*
|
||||||
|
|
||||||
|
while [ ! -z "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
-zs )
|
||||||
|
SERVERNAME=$2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
# validation: unset SERVERNAME if it looks like another switch
|
||||||
|
if [ -n "$SERVERNAME" ]; then
|
||||||
|
TEST_SN=`echo $SERVERNAME | grep "^-"`
|
||||||
|
[ -n "$TEST_SN" ] && SERVERNAME=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if svc_t_need_servername; then
|
||||||
|
[ -z "$SERVERNAME" ] && output_fatal_error "${ERR_REQDASHZS}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$SERVERNAME"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,145 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
svc_t_init()
|
||||||
|
############
|
||||||
|
{
|
||||||
|
NOOP=NOOP
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolname()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
echo "dbsrv"`get_major_version`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolspath()
|
||||||
|
#################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
# 's' path is the script or shortcut path for this tool
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/${BIN}s/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolpath()
|
||||||
|
################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/$BIN/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_has_servername()
|
||||||
|
######################
|
||||||
|
{
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_need_servername()
|
||||||
|
#######################
|
||||||
|
{
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_get_servername_from_cmdline()
|
||||||
|
###################################
|
||||||
|
{
|
||||||
|
while [ ! -z "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
-n )
|
||||||
|
echo $2
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_cmdline()
|
||||||
|
#######################
|
||||||
|
# in: cmdline
|
||||||
|
# out: add -ud if not already there
|
||||||
|
# out: (global) $SERVERNAME is set
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=`svc_t_process_cmdline_add_ud $*`
|
||||||
|
|
||||||
|
while [ ! -z "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
-n )
|
||||||
|
# servername is first parm to first -n
|
||||||
|
[ -z "$SERVERNAME" ] && SERVERNAME=$2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
# validation: unset SERVERNAME if it looks like another switch
|
||||||
|
if [ -n "$SERVERNAME" ]; then
|
||||||
|
TEST_SN=`echo $SERVERNAME | grep "^-"`
|
||||||
|
[ -n "$TEST_SN" ] && SERVERNAME=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$MY_CMDLINE"
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_servername()
|
||||||
|
##########################
|
||||||
|
# in: cmdline
|
||||||
|
# out: servername
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=$*
|
||||||
|
|
||||||
|
while [ ! -z "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
-n )
|
||||||
|
# servername is first parm to first -n
|
||||||
|
[ -z "$SERVERNAME" ] && SERVERNAME=$2
|
||||||
|
;;
|
||||||
|
@* )
|
||||||
|
# process parms in env variable or file
|
||||||
|
local parm=$1
|
||||||
|
parm=`echo $parm | sed -e "s/^@//"`
|
||||||
|
local parme="\$${parm}"
|
||||||
|
local parmeval=`eval echo ${parme}`
|
||||||
|
local process_args
|
||||||
|
if [ "${parmeval}" != "" ]; then
|
||||||
|
# add contents of env. var. too
|
||||||
|
process_args=${parmeval}
|
||||||
|
elif [ -r ${parm} ]; then
|
||||||
|
process_args=`cat ${parm}`
|
||||||
|
fi
|
||||||
|
for arg in "$process_args"; do
|
||||||
|
case $arg in
|
||||||
|
-n )
|
||||||
|
# servername is first parm to first -n
|
||||||
|
[ -z "$SERVERNAME" ] && SERVERNAME=$2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
# validation: unset SERVERNAME if it looks like another switch
|
||||||
|
if [ -n "$SERVERNAME" ]; then
|
||||||
|
TEST_SN=`echo $SERVERNAME | grep "^-"`
|
||||||
|
[ -n "$TEST_SN" ] && SERVERNAME=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if svc_t_need_servername; then
|
||||||
|
[ -z "$SERVERNAME" ] && output_msg "${ERR_REQDASHN}" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$SERVERNAME"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Most tools check status by verifying the process is still running
|
||||||
|
# We can do a bit better with dbping
|
||||||
|
# svc_t_status()
|
||||||
|
# {
|
||||||
|
# "$SQLANYDIR/$BIN/dbping" -c "eng=${SERVERNAME}" -q 2>/dev/null >/dev/null
|
||||||
|
# echo $?
|
||||||
|
# }
|
||||||
|
|
@ -0,0 +1,123 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
svc_t_init()
|
||||||
|
############
|
||||||
|
{
|
||||||
|
NOOP=NOOP
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolname()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
echo "dbeng"`get_major_version`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolspath()
|
||||||
|
#################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
# 's' path is the script or shortcut path for this tool
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/${BIN}s/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolpath()
|
||||||
|
################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/$BIN/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_has_servername()
|
||||||
|
######################
|
||||||
|
{
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_need_servername()
|
||||||
|
#######################
|
||||||
|
{
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_get_servername_from_cmdline()
|
||||||
|
###################################
|
||||||
|
{
|
||||||
|
while [ ! -z "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
-n )
|
||||||
|
echo $2
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_cmdline()
|
||||||
|
#######################
|
||||||
|
# in: cmdline
|
||||||
|
# out: add -ud if not already there
|
||||||
|
# out: (global) $SERVERNAME is set
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=`svc_t_process_cmdline_add_ud $*`
|
||||||
|
|
||||||
|
while [ ! -z "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
-n )
|
||||||
|
# servername is first parm to first -n
|
||||||
|
[ -z "$SERVERNAME" ] && SERVERNAME=$2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
# validation: unset SERVERNAME if it looks like another switch
|
||||||
|
if [ -n "$SERVERNAME" ]; then
|
||||||
|
TEST_SN=`echo $SERVERNAME | grep "^-"`
|
||||||
|
[ -n "$TEST_SN" ] && SERVERNAME=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$MY_CMDLINE"
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_servername()
|
||||||
|
##########################
|
||||||
|
# in: cmdline
|
||||||
|
# out: servername
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=$*
|
||||||
|
|
||||||
|
while [ ! -z "$1" ]; do
|
||||||
|
case $1 in
|
||||||
|
-n )
|
||||||
|
# servername is first parm to first -n
|
||||||
|
[ -z "$SERVERNAME" ] && SERVERNAME=$2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
# validation: unset SERVERNAME if it looks like another switch
|
||||||
|
if [ -n "$SERVERNAME" ]; then
|
||||||
|
TEST_SN=`echo $SERVERNAME | grep "^-"`
|
||||||
|
[ -n "$TEST_SN" ] && SERVERNAME=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if svc_t_need_servername; then
|
||||||
|
[ -z "$SERVERNAME" ] && output_fatal_error "${ERR_REQDASHN}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$SERVERNAME"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Most tools check status by verifying the process is still running
|
||||||
|
# We can do a bit better with dbping
|
||||||
|
# svc_t_status()
|
||||||
|
# {
|
||||||
|
# "$SQLANYDIR/$BIN/dbping" -c "eng=${SERVERNAME}" -q 2>/dev/null >/dev/null
|
||||||
|
# echo $?
|
||||||
|
# }
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
svc_t_init()
|
||||||
|
############
|
||||||
|
{
|
||||||
|
NOOP=NOOP
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolname()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
echo "rshost"
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolspath()
|
||||||
|
#################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
# 's' path is the script or shortcut path for this tool
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/${BIN}s/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolpath()
|
||||||
|
################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/$BIN/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_has_servername()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_need_servername()
|
||||||
|
#################
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_cmdline()
|
||||||
|
#######################
|
||||||
|
# in: cmdline
|
||||||
|
# out: add -ud if not already there
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=`svc_t_process_cmdline_add_ud $*`
|
||||||
|
|
||||||
|
echo "$MY_CMDLINE"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# iAnywhere Solutions, Inc. One Sybase Drive, Dublin, CA 94568, USA
|
||||||
|
# Copyright (c) 2001-2008, iAnywhere Solutions, Inc. Portions copyright (c)
|
||||||
|
# 1988-2008, Sybase, Inc. All rights preserved. All unpublished rights reserved.
|
||||||
|
|
||||||
|
svc_t_init()
|
||||||
|
############
|
||||||
|
{
|
||||||
|
NOOP=NOOP
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolname()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
echo "rsoe"
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolspath()
|
||||||
|
#################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
# 's' path is the script or shortcut path for this tool
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/${BIN}s/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_toolpath()
|
||||||
|
################
|
||||||
|
# can look at $BITNESS, $BIN32, etc. here to override bitness
|
||||||
|
{
|
||||||
|
echo $SQLANYDIR/$BIN/`svc_t_toolname`
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_has_servername()
|
||||||
|
################
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_need_servername()
|
||||||
|
#################
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
svc_t_process_cmdline()
|
||||||
|
#######################
|
||||||
|
# in: cmdline
|
||||||
|
# out: add -ud if not already there
|
||||||
|
{
|
||||||
|
local MY_CMDLINE=`svc_t_process_cmdline_add_ud $*`
|
||||||
|
|
||||||
|
echo "$MY_CMDLINE"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
svc_t_personal
|
||||||
|
|
@ -0,0 +1,145 @@
|
||||||
|
# ***************************************************************************
|
||||||
|
# Copyright (c) 2013 SAP AG or an SAP affiliate company. All rights reserved.
|
||||||
|
# ***************************************************************************
|
||||||
|
toupper()
|
||||||
|
#########
|
||||||
|
{
|
||||||
|
echo "$*" | tr a-z A-Z
|
||||||
|
}
|
||||||
|
|
||||||
|
tolower()
|
||||||
|
#########
|
||||||
|
{
|
||||||
|
echo "$*" | tr A-Z a-z
|
||||||
|
}
|
||||||
|
|
||||||
|
not()
|
||||||
|
#####
|
||||||
|
{
|
||||||
|
CMD=""
|
||||||
|
while [ -n "${1:-}" ] ; do
|
||||||
|
CMD="$CMD \"$1\""
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if eval "$CMD" ; then
|
||||||
|
false
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_tool_requirements()
|
||||||
|
#########################
|
||||||
|
{
|
||||||
|
local sedtest awktest greptest trtest tailtest
|
||||||
|
|
||||||
|
# make sure sed understands substituting hex codes
|
||||||
|
sedtest=`echo "o o" | sed 's/ /\x00/'`
|
||||||
|
if [ "$sedtest" = "ox00o" ]; then
|
||||||
|
output_fatal_error "${ERR_SED}"
|
||||||
|
fi
|
||||||
|
# check existence of other required tools
|
||||||
|
awktest=`echo "awktest" | awk '{print $1}'`
|
||||||
|
if [ "$awktest" != "awktest" ]; then
|
||||||
|
output_fatal_error "${ERR_AWK}"
|
||||||
|
fi
|
||||||
|
greptest=`echo "greptest" | grep 'greptest'`
|
||||||
|
if [ "$greptest" != "greptest" ]; then
|
||||||
|
output_fatal_error "${ERR_GREP}"
|
||||||
|
fi
|
||||||
|
# tailtest=`echo "tailtest" | tail --lines 1`
|
||||||
|
# if [ "$tailtest" != "tailtest" ]; then
|
||||||
|
# output_fatal_error "${ERR_TAIL}"
|
||||||
|
# fi
|
||||||
|
trtest=`echo "trtest" | tr a-z a-z`
|
||||||
|
if [ "$trtest" != "trtest" ]; then
|
||||||
|
output_fatal_error "${ERR_TR}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
output_msg()
|
||||||
|
###########
|
||||||
|
{
|
||||||
|
## [ ${QUIET:-0} -ne 0 ] && return ;
|
||||||
|
|
||||||
|
JUNK=`eval echo "$*"`
|
||||||
|
echo "$JUNK"
|
||||||
|
}
|
||||||
|
|
||||||
|
output_fatal_error()
|
||||||
|
####################
|
||||||
|
{
|
||||||
|
JUNK=`eval echo "$*"`
|
||||||
|
echo "$JUNK" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
output_usage_error()
|
||||||
|
####################
|
||||||
|
{
|
||||||
|
JUNK=`eval echo "$*"`
|
||||||
|
echo "$JUNK" >&2
|
||||||
|
usage
|
||||||
|
}
|
||||||
|
|
||||||
|
cui_echo()
|
||||||
|
##########
|
||||||
|
{
|
||||||
|
## [ ${QUIET:-0} -eq 0 ] && echo "$*"
|
||||||
|
NOOP=NOOP
|
||||||
|
}
|
||||||
|
|
||||||
|
cui_eval_echo()
|
||||||
|
###############
|
||||||
|
{
|
||||||
|
## [ ${QUIET:-0} -ne 0 ] && return ;
|
||||||
|
|
||||||
|
JUNK=`eval echo "$*"`
|
||||||
|
echo "$JUNK"
|
||||||
|
}
|
||||||
|
|
||||||
|
cui_wait_for_input()
|
||||||
|
####################
|
||||||
|
# $2 - default response if the user hits enter in interactive mode
|
||||||
|
{
|
||||||
|
if [ ${AUTOYES:-1} -eq 1 ] && [ -n "${2:-}" ] ; then
|
||||||
|
CUI_RESPONSE="${2:-}"
|
||||||
|
else
|
||||||
|
cui_eval_echo "${1:-}"
|
||||||
|
read CUI_RESPONSE
|
||||||
|
[ -z "${CUI_RESPONSE:-}" ] && CUI_RESPONSE="${2:-}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
cui_ask_y_n()
|
||||||
|
#############
|
||||||
|
# $1 - prompt question
|
||||||
|
# $2 - default answer "Y" or "N" (influences key Y/n or N/y)
|
||||||
|
{
|
||||||
|
if [ ${AUTOYES:-1} -eq 1 ] ; then
|
||||||
|
true
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
_DEFAULT_ANSWER=${2:-N}
|
||||||
|
|
||||||
|
if [ "${_DEFAULT_ANSWER}" = "Y" ] ; then
|
||||||
|
_PROMPT="${MSG_PROMPT_YES_NO}"
|
||||||
|
else
|
||||||
|
_PROMPT="${MSG_PROMPT_NO_YES}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cui_echo ""
|
||||||
|
cui_wait_for_input "${1} ${_PROMPT}" "${_DEFAULT_ANSWER}"
|
||||||
|
|
||||||
|
case $CUI_RESPONSE in
|
||||||
|
"${MSG_ANSWER_yes}" | "${MSG_ANSWER_Yes}" | "${MSG_ANSWER_y}" | "${MSG_ANSWER_Y}" )
|
||||||
|
true
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
false
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,166 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Invoke HTML viewer
|
||||||
|
# Usage:
|
||||||
|
# htmlview [URL]
|
||||||
|
#
|
||||||
|
# WARNING: Deprecated Script
|
||||||
|
# This script will be replaced in the future when something better is implemented.
|
||||||
|
#
|
||||||
|
# v3.0.0
|
||||||
|
# ------
|
||||||
|
# If DISPLAY is set and gnome-open exists, mimic gnome-open behavior to launch
|
||||||
|
# preferred browser. Due to MIME associations, gnome-open cannot be directly
|
||||||
|
# called to view files from htmlview because it will go into an infinite loop.
|
||||||
|
# text/html associated with htmlview runs mimic_gnome_open, which Just Works.
|
||||||
|
# (Otherwise fallback to old htmlview behavior.)
|
||||||
|
#
|
||||||
|
# ~/.htmlviewrc and /etc/htmlview.conf.
|
||||||
|
# Users may define the TEXTBROWSER variable to
|
||||||
|
# indicate their preference for old htmlview.
|
||||||
|
#
|
||||||
|
# /usr/bin/gnome-default-applications-properties
|
||||||
|
# Please use the Preferred Application chooser
|
||||||
|
# for all other configuration options.
|
||||||
|
#
|
||||||
|
# written by Bernhard Rosenkraenzer <bero@redhat.com>
|
||||||
|
# changed by Warren Togami <wtogami@redhat.com>
|
||||||
|
# (c) 2000-2004 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This script is in the public domain.
|
||||||
|
|
||||||
|
error_dialog() {
|
||||||
|
echo "$1"
|
||||||
|
if [ -x /usr/bin/zenity ]; then
|
||||||
|
/usr/bin/zenity --error --text="$1"
|
||||||
|
else
|
||||||
|
xmessage "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
mimic_gnome_open() {
|
||||||
|
NEEDTERM=$(gconftool-2 -g /desktop/gnome/url-handlers/http/needs_terminal 2>/dev/null | sed -e 's/^\ *//; s/\ *$//')
|
||||||
|
# Check if text-mode browser
|
||||||
|
if [ "$NEEDTERM" == "true" ]; then
|
||||||
|
PREFTERM=$(gconftool-2 -g /desktop/gnome/applications/terminal/exec 2>/dev/null | sed -e 's/^\ *//; s/\ *$//')
|
||||||
|
TERMARGS=$(gconftool-2 -g /desktop/gnome/applications/terminal/exec_arg 2>/dev/null | sed -e 's/^\ *//; s/\ *$//')
|
||||||
|
# Check if terminal exists
|
||||||
|
if ! exists "$PREFTERM"; then
|
||||||
|
error_dialog "ERROR: The terminal $PREFTERM does not exist. Please reconfigure."
|
||||||
|
[ -x /usr/bin/gnome-default-applications-properties ] && exec /usr/bin/gnome-default-applications-properties
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Special case: w3m
|
||||||
|
[ "$GCONF" = "w3m" ] && GCONF="w3m -v"
|
||||||
|
# Run text-mode browser
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
exec $PREFTERM $TERMARGS $GCONF
|
||||||
|
else
|
||||||
|
exec $PREFTERM $TERMARGS $GCONF "$1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if GUI browser exists
|
||||||
|
if ! exists "$GCONF"; then
|
||||||
|
error_dialog "ERROR: The browser $GCONF does not exist. Please reconfigure."
|
||||||
|
[ -x /usr/bin/gnome-default-applications-properties ] && exec /usr/bin/gnome-default-applications-properties
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Special case: konqueror without arguments
|
||||||
|
if [ "$GCONF" = "konqueror" ] && [ -z $1 ]; then
|
||||||
|
GCONF="konqueror about:konqueror"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run GUI browser
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
exec $GCONF
|
||||||
|
else
|
||||||
|
exec $GCONF "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
sanity_check() {
|
||||||
|
unset INVALID
|
||||||
|
echo "$1" | grep -q "htmlview" && INVALID="yes"
|
||||||
|
echo "$1" | grep -q "gnome-open" && INVALID="yes"
|
||||||
|
if [ "$INVALID" == "yes" ]; then
|
||||||
|
error_dialog "$1 is an invalid browser. Please reconfigure."
|
||||||
|
[ -x /usr/bin/gnome-default-applications-properties ] && exec /usr/bin/gnome-default-applications-properties
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
exists() {
|
||||||
|
which "${1%% *}" 2> /dev/null > /dev/null
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
|
# ignore legacy cruft
|
||||||
|
if [ "$1" == "--remote" ]; then
|
||||||
|
shift
|
||||||
|
elif [ "$1" == "--local" ]; then
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Read GNOME configuration
|
||||||
|
if [ -x /usr/bin/gconftool-2 ]; then
|
||||||
|
# Pull key from gconf, remove %s or "%s", trim leading & trailing spaces
|
||||||
|
GCONF=$(gconftool-2 -g /desktop/gnome/url-handlers/http/command 2>/dev/null | sed -e 's/%s//; s/\"\"//; s/^\ *//; s/\ *$//')
|
||||||
|
|
||||||
|
# sanity check (prevent infinite loops)
|
||||||
|
sanity_check "$GCONF"
|
||||||
|
|
||||||
|
# GNOME 2.4+ mimic gnome-open behavior to launch browser
|
||||||
|
if [ ! -z $DISPLAY ] && [ -x /usr/bin/gnome-open ]; then
|
||||||
|
mimic_gnome_open "$*"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fallback to old htmlview
|
||||||
|
unset BROWSER CONSOLE TERMS_KDE TERMS_GNOME TERMS_GENERIC
|
||||||
|
[ -e /etc/htmlview.conf ] && source /etc/htmlview.conf
|
||||||
|
[ -e ~/.htmlviewrc ] && source ~/.htmlviewrc
|
||||||
|
|
||||||
|
TERMS_KDE="/usr/bin/konsole /usr/bin/kvt"
|
||||||
|
TERMS_GNOME="/usr/bin/gnome-terminal"
|
||||||
|
TERMS_GENERIC="/usr/bin/rxvt /usr/X11R6/bin/xterm /usr/bin/Eterm"
|
||||||
|
TTYBROWSERS="/usr/bin/links /usr/bin/lynx /usr/bin/w3m"
|
||||||
|
X11BROWSERS_KDE="/usr/bin/konqueror /usr/bin/kfmbrowser"
|
||||||
|
X11BROWSERS_GNOME="/usr/bin/mozilla /usr/bin/epiphany /usr/bin/galeon"
|
||||||
|
X11BROWSERS_GENERIC="/usr/bin/mozilla /usr/bin/netscape"
|
||||||
|
|
||||||
|
if [ "x`/sbin/pidof gnome-session`" != "x" ]; then
|
||||||
|
X11BROWSERS="$GCONF $X11BROWSERS_GENERIC $X11BROWSERS_GNOME $X11BROWSERS_KDE"
|
||||||
|
TERMS="$CONSOLE $TERMS_GENERIC $TERMS_GNOME $TERMS_KDE"
|
||||||
|
else
|
||||||
|
X11BROWSERS="$X11BROWSERS_GENERIC $X11BROWSERS_KDE $X11BROWSERS_GNOME"
|
||||||
|
TERMS="$CONSOLE $TERMS_GENERIC $TERMS_KDE $TERMS_GNOME"
|
||||||
|
fi
|
||||||
|
[ -n "$X11BROWSER" ] && X11BROWSERS="$X11BROWSER $X11BROWSERS"
|
||||||
|
[ -n "$TEXTBROWSER" ] && TTYBROWSERS="$TEXTBROWSER $TTYBROWSERS"
|
||||||
|
[ -n "$CONSOLE" ] && TERMS="$CONSOLE $TERMS"
|
||||||
|
|
||||||
|
if test "x$DISPLAY" = x; then
|
||||||
|
for i in $TTYBROWSERS; do
|
||||||
|
if exists $i; then
|
||||||
|
exec $i $*
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo $"No valid text mode browser found."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
for i in $X11BROWSERS; do
|
||||||
|
exists $i && exec $i $*
|
||||||
|
done
|
||||||
|
for i in $TERMS; do
|
||||||
|
if exists $i; then
|
||||||
|
CONSOLE="$i -e"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
for i in $TTYBROWSERS; do
|
||||||
|
exists $i && exec $CONSOLE $i $*
|
||||||
|
done
|
||||||
|
echo $"No valid browser found."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
###########################################################################
|
||||||
|
#
|
||||||
|
# SAP JVM JIT Compiler Exclude List
|
||||||
|
#
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# format:
|
||||||
|
#
|
||||||
|
# exclude <package 1>/<package 2>/.../<package N>/<class name> <method name>
|
||||||
|
#
|
||||||
|
# example:
|
||||||
|
#
|
||||||
|
# exclude com/sun/tools/javac/code/SymbolMethodSymbol overrides
|
||||||
|
#
|
||||||
|
|
||||||
|
# For new entries, please provide date, SAP JVM Bug ID, SAP note, Sun Bug ID
|
||||||
|
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
Copyright © 1993, 2013, Oracle and/or its affiliates.
|
||||||
|
Copyright 2013 SAP AG, Dietmar-Hopp-Allee 16, 69190 Walldorf, Germany.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
This software and related documentation are provided under a
|
||||||
|
license agreement containing restrictions on use and
|
||||||
|
disclosure and are protected by intellectual property laws.
|
||||||
|
Except as expressly permitted in your license agreement or
|
||||||
|
allowed by law, you may not use, copy, reproduce, translate,
|
||||||
|
broadcast, modify, license, transmit, distribute, exhibit,
|
||||||
|
perform, publish, or display any part, in any form, or by
|
||||||
|
any means. Reverse engineering, disassembly, or
|
||||||
|
decompilation of this software, unless required by law for
|
||||||
|
interoperability, is prohibited.
|
||||||
|
|
||||||
|
The information contained herein is subject to change
|
||||||
|
without notice and is not warranted to be error-free. If
|
||||||
|
you find any errors, please report them to us in writing.
|
||||||
|
|
||||||
|
If this is software or related software documentation that
|
||||||
|
is delivered to the U.S. Government or anyone licensing it
|
||||||
|
on behalf of the U.S. Government, the following notice is
|
||||||
|
applicable:
|
||||||
|
|
||||||
|
U.S. GOVERNMENT RIGHTS Programs, software, databases, and
|
||||||
|
related documentation and technical data delivered to U.S.
|
||||||
|
Government customers are "commercial computer software" or
|
||||||
|
"commercial technical data" pursuant to the applicable
|
||||||
|
Federal Acquisition Regulation and agency-specific
|
||||||
|
supplemental regulations. As such, the use, duplication,
|
||||||
|
disclosure, modification, and adaptation shall be subject to
|
||||||
|
the restrictions and license terms set forth in the
|
||||||
|
applicable Government contract, and, to the extent
|
||||||
|
applicable by the terms of the Government contract, the
|
||||||
|
additional rights set forth in FAR 52.227-19, Commercial
|
||||||
|
Computer Software License (December 2007). Oracle America,
|
||||||
|
Inc., 500 Oracle Parkway, Redwood City, CA 94065.
|
||||||
|
|
||||||
|
This software or hardware is developed for general use in a
|
||||||
|
variety of information management applications. It is not
|
||||||
|
developed or intended for use in any inherently dangerous
|
||||||
|
applications, including applications which may create a risk
|
||||||
|
of personal injury. If you use this software or hardware in
|
||||||
|
dangerous applications, then you shall be responsible to
|
||||||
|
take all appropriate fail-safe, backup, redundancy, and
|
||||||
|
other measures to ensure its safe use. Oracle Corporation
|
||||||
|
and its affiliates disclaim any liability for any damages
|
||||||
|
caused by use of this software or hardware in dangerous
|
||||||
|
applications.
|
||||||
|
|
||||||
|
Oracle and Java are registered trademarks of Oracle and/or
|
||||||
|
its affiliates. Other names may be trademarks of their
|
||||||
|
respective owners.
|
||||||
|
|
||||||
|
AMD, Opteron, the AMD logo, and the AMD Opteron logo are
|
||||||
|
trademarks or registered trademarks of Advanced Micro
|
||||||
|
Devices. Intel and Intel Xeon are trademarks or registered
|
||||||
|
trademarks of Intel Corporation. All SPARC trademarks are
|
||||||
|
used under license and are trademarks or registered
|
||||||
|
trademarks of SPARC International, Inc. UNIX is a
|
||||||
|
registered trademark licensed through X/Open Company, Ltd.
|
||||||
|
|
||||||
|
This software or hardware and documentation may provide
|
||||||
|
access to or information on content, products, and services
|
||||||
|
from third parties. Oracle Corporation and its affiliates
|
||||||
|
are not responsible for and expressly disclaim all
|
||||||
|
warranties of any kind with respect to third-party content,
|
||||||
|
products, and services. Oracle Corporation and its
|
||||||
|
affiliates will not be responsible for any loss, costs, or
|
||||||
|
damages incurred due to your access to or use of third-party
|
||||||
|
content, products, or services.
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Please refer to http://java.com/licensereadme
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,28 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>
|
||||||
|
Welcome to the Java(TM) Platform
|
||||||
|
</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h2>Welcome to the Java<SUP><FONT SIZE=-2>TM</FONT></SUP> Platform</h2>
|
||||||
|
<p> Welcome to the Java<SUP><FONT SIZE=-2>TM</FONT></SUP> Standard Edition Runtime
|
||||||
|
Environment. This provides complete runtime support for Java applications.
|
||||||
|
<p> The runtime environment includes the Java<SUP><FONT SIZE=-2>TM</FONT></SUP>
|
||||||
|
Plug-in product which supports the Java environment inside web browsers.
|
||||||
|
<h3>References</h3>
|
||||||
|
<p>
|
||||||
|
See the <a href="http://download.oracle.com/javase/7/docs/technotes/guides/plugin/">Java Plug-in</a> product
|
||||||
|
documentation for more information on using the Java Plug-in product.
|
||||||
|
<p> See the <a href=
|
||||||
|
"http://www.oracle.com/technetwork/java/javase/overview/"
|
||||||
|
>Java Platform</a> web site for
|
||||||
|
more information on the Java Platform.
|
||||||
|
<hr>
|
||||||
|
<font size="-2">
|
||||||
|
Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
</font>
|
||||||
|
<p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1 @@
|
||||||
|
-server KNOWN
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue