From 11e1bfcdec2eba9e3e62f27ecaa9b51ffac14e71 Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Sun, 13 Mar 2005 16:04:59 +0000 Subject: [PATCH] merge 1.5 install files to 2.0 --- .../linux/classic/makeInstallImage.sh.in | 22 +- .../linux/classic/postinstall.sh.in | 190 ++++++++++++------ .../linux/classic/postuninstall.sh.in | 39 +++- .../linux/classic/preinstall.sh.in | 96 +-------- .../linux/classic/preuninstall.sh.in | 9 +- .../linux/classic/rpmheader.txt.in | 2 +- .../linux/misc/changeDBAPassword.sh.in | 117 ++++++++--- .../misc/changeGdsLibraryCompatibleLink.sh.in | 186 +++++++++++++++++ .../linux/misc/createAliasDB.sh.in | 161 +++++++++++++++ .../linux/misc/firebird.init.d.debian.in | 2 +- .../linux/misc/firebird.init.d.mandrake.in | 1 + .../linux/misc/firebird.init.d.suse.in | 20 +- builds/install/misc/changeDBAPassword.sh.in | 70 ++----- builds/install/misc/fb_config.in | 86 ++++++++ 14 files changed, 721 insertions(+), 280 deletions(-) create mode 100644 builds/install/arch-specific/linux/misc/changeGdsLibraryCompatibleLink.sh.in create mode 100644 builds/install/arch-specific/linux/misc/createAliasDB.sh.in create mode 100644 builds/install/misc/fb_config.in diff --git a/builds/install/arch-specific/linux/classic/makeInstallImage.sh.in b/builds/install/arch-specific/linux/classic/makeInstallImage.sh.in index d74898d15e..f1c7090f92 100644 --- a/builds/install/arch-specific/linux/classic/makeInstallImage.sh.in +++ b/builds/install/arch-specific/linux/classic/makeInstallImage.sh.in @@ -30,7 +30,7 @@ # Contributor(s): # # -# $Id: makeInstallImage.sh.in,v 1.8 2005-02-24 12:23:02 alexpeshkoff Exp $ +# $Id: makeInstallImage.sh.in,v 1.9 2005-03-13 16:04:33 alexpeshkoff Exp $ # # Script to copy install files from the build/transport area @@ -123,6 +123,9 @@ copyFiles() { cp $BuiltFBDir/bin/CSchangeRunUser.sh $DestDir/bin cp $BuiltFBDir/bin/CSrestoreRootRunUser.sh $DestDir/bin cp $BuiltFBDir/bin/changeDBAPassword.sh $DestDir/bin + cp $BuiltFBDir/bin/changeGdsLibraryCompatibleLink.sh $DestDir/bin + cp $BuiltFBDir/bin/createAliasDB.sh $DestDir/bin + cp $BuiltFBDir/bin/fb_config $DestDir/bin # Copy examples only if we have them @@ -144,7 +147,7 @@ copyFiles() { #cp -r $BuiltFBDir/doc $DestDir cp $BuiltFBDir/firebird.msg $DestDir/firebird.msg - cp $BuiltFBDir/security2.fdb $DestDir/security2.fdb + cp $BuiltFBDir/$SecurityDatabase $DestDir/$SecurityDatabase # cp $BuiltFBDir/include/gds.f $DestDir/include @@ -154,7 +157,7 @@ copyFiles() { cp -df $BuiltFBDir/lib/libfbembed.so* $DestDir/lib cp -df $BuiltFBDir/lib/libfbclient.so* $DestDir/lib -# cp -f $BuiltFBDir/lib/gds.a /usr/lib/libgds.a +# cp -f $BuiltFBDir/lib/gds.a @libdir@/libgds.a cp -f $BuiltFBDir/lib/libib_util.so $DestDir/lib/libib_util.so @@ -176,16 +179,8 @@ copyFiles() { cp $BuiltFBDir/misc/firebird.xinetd $DestDir/misc/firebird.xinetd cp $BuiltFBDir/misc/firebird.conf $DestDir/firebird.conf + cp $BuiltFBDir/misc/aliases.conf $DestDir/aliases.conf - echo "#" >> $DestDir/aliases.conf - echo "# List of known database aliases" >> $DestDir/aliases.conf - echo "# ------------------------------" >> $DestDir/aliases.conf - echo "#" >> $DestDir/aliases.conf - echo "# Examples:" >> $DestDir/aliases.conf - echo "#" >> $DestDir/aliases.conf - echo "# employee = /$FBRootDir/examples/employee.fdb" >> $DestDir/aliases.conf - echo "#" >> $DestDir/aliases.conf - # Create links from @libdir@ to install area. @@ -199,7 +194,7 @@ copyFiles() { # link include files to /usr/include - for i in iberror.h ibase.h ib_util.h + for i in gds.h iberror.h ibase.h ib_util.h do ln -s ../../$FBRootDir/include/$i $TargetDir/usr/include/$i done @@ -217,5 +212,6 @@ copyFiles() { #=== MAIN ==================================================================== +SecurityDatabase=security2.fdb copyFiles diff --git a/builds/install/arch-specific/linux/classic/postinstall.sh.in b/builds/install/arch-specific/linux/classic/postinstall.sh.in index 3a643f5fef..b74b502712 100644 --- a/builds/install/arch-specific/linux/classic/postinstall.sh.in +++ b/builds/install/arch-specific/linux/classic/postinstall.sh.in @@ -1,6 +1,6 @@ #!/bin/sh # -# This library is part of the FirebirdSQL project +# This library is part of the Firebird project # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -31,7 +31,7 @@ # Contributor(s): # # -# $Id: postinstall.sh.in,v 1.8 2005-02-24 12:23:02 alexpeshkoff Exp $ +# $Id: postinstall.sh.in,v 1.9 2005-03-13 16:04:33 alexpeshkoff Exp $ # # The post install script for Firebird Classic @@ -88,6 +88,46 @@ replaceLineInFile() { fi } +#------------------------------------------------------------------------ +# Detect Distribution. + +detectDistro() { + + # it's not provided... + if [ -z "$linuxDistro" ] + then + if [ -e /etc/SuSE-release ] + then + # SuSE + linuxDistro="SuSE" + elif [ -e /etc/mandrake-release ] + then + # Mandrake + linuxDistro="MDK" + elif [ -e /etc/debian_version ] + then + # Debian + linuxDistro="Debian" + elif [ -e /etc/gentoo-release ] + then + # Debian + linuxDistro="Gentoo" + elif [ -e /etc/rc.d/init.d/functions ] + then + # very likely Red Hat + linuxDistro="RH" + elif [ -d /etc/rc.d/init.d ] + then + # generic Red Hat + linuxDistro="G-RH" + elif [ -d /etc/init.d ] + then + # generic SuSE + linuxDistro="G-SuSE" + fi + fi +} + #------------------------------------------------------------------------ # Add new user and group @@ -96,18 +136,14 @@ addFirebirdUser() { testStr=`grep firebird /etc/group` - if [ -z "$testStr" ] - then + if [ -z "$testStr" ]; then groupadd firebird fi testStr=`grep firebird /etc/passwd` - if [ -z "$testStr" ] - then + if [ -z "$testStr" ]; then useradd -M -d $FBRootDir -s /bin/bash \ -c "Firebird Database Administrator" -g firebird firebird - - # >/dev/null 2>&1 fi } @@ -189,32 +225,43 @@ updateInetdServiceEntry() { #------------------------------------------------------------------------ -# Unable to generate the password for the rpm, so put out a message -# instead +# Write new password to the @prefix@/SYSDBA.password file +writeNewPassword() { -keepOrigDBAPassword() { + NewPasswd=$1 - DBAPasswordFile=$FBRootDir/SYSDBA.password - - NewPasswd='masterkey' - echo "Firebird initial install password " > $DBAPasswordFile - echo "for user SYSDBA is : $NewPasswd" >> $DBAPasswordFile - - echo "for install on `hostname` at time `date`" >> $DBAPasswordFile - echo "You should change this password at the earliest oportunity" >> $DBAPasswordFile - echo "" - - echo "(For superserver you will also want to check the password in the" >> $DBAPasswordFile - echo "daemon init routine in the file /etc/init.d/firebird)" >> $DBAPasswordFile - echo "" >> $DBAPasswordFile - echo "Your should password can be changed to a more suitable one using the" >> $DBAPasswordFile - echo "@prefix@/bin/changeDBAPassword.sh script" >> $DBAPasswordFile + echo "# Firebird generated password for user SYSDBA is: " > $DBAPasswordFile echo "" >> $DBAPasswordFile + echo "ISC_USER=sysdba" >> $DBAPasswordFile + echo "ISC_PASSWD=$NewPasswd" >> $DBAPasswordFile + echo "" >> $DBAPasswordFile + + if [ $NewPasswd = "masterkey" ] + then + echo "# for install on `hostname` at time `date`" >> $DBAPasswordFile + echo "# You should change this password at the earliest oportunity" >> $DBAPasswordFile + else + echo "# generated on `hostname` at time `date`" >> $DBAPasswordFile + fi + echo "" >> $DBAPasswordFile + echo "# Your password can be changed to a more suitable one using the" >> $DBAPasswordFile + echo "# @prefix@/bin/changeDBAPassword.sh script" >> $DBAPasswordFile + + echo "" >> $DBAPasswordFile chmod u=r,go= $DBAPasswordFile + # Only if we have changed the password from the default do we need + # to update the entry in the database + + if [ $NewPasswd != "masterkey" ] + then + $FBBin/gsec -user sysdba -password masterkey < $DBAPasswordFile - echo "for user SYSDBA is : $NewPasswd" >> $DBAPasswordFile - echo "generated on `hostname` at time `date`" >> $DBAPasswordFile - #echo "(For superserver you will also want to check the password in the" >> $DBAPasswordFile - #echo "daemon init routine in the file /etc/rc.d/init.d/firebird)" >> $DBAPasswordFile - echo "" >> $DBAPasswordFile - echo "Your password can be changed to a more suitable one using the" >> $DBAPasswordFile - echo "@prefix@/bin/changeDBAPassword.sh script" >> $DBAPasswordFile - echo "" >> $DBAPasswordFile - chmod u=r,go= $DBAPasswordFile - - $FBBin/gsec -user sysdba -password masterkey < libfbembed.so since that is compatible to + # the existing behaviour of previous installs. (There is also a + # script installed to allow the user to change the option) MOD 23-Dec-2003 + + + #newLibrary=$FBRootDir/lib/libfbclient.so + newLibrary=$FBRootDir/lib/libfbembed.so + + # Remove if only a link + if [ -L @libdir@/libgds.so ] + then + rm -f @libdir@/libgds.so + fi + if [ ! -e @libdir@/libgds.so ] then - ln -s $FBRootDir/lib/libfbembed.so @libdir@/libgds.so + ln -s $newLibrary @libdir@/libgds.so + fi + + # Remove if only a link + if [ -L @libdir@/libgds.so.0 ] + then + rm -f @libdir@/libgds.so.0 fi if [ ! -e @libdir@/libgds.so.0 ] then - ln -s $FBRootDir/lib/libfbembed.so @libdir@/libgds.so.0 + ln -s $newLibrary @libdir@/libgds.so.0 fi @@ -645,6 +699,9 @@ createLinksForBackCompatibility() { + # Detect which linux distro we are installing on + detectDistro + # Make sure the links are in place if [ -z "$FirebirdInstallPrefix" ] then @@ -657,6 +714,7 @@ createLinksForBackCompatibility() { FBBin=$FBRootDir/bin # RunUser=root RunUser=firebird + SecurityDatabase=security2.fdb # Update /etc/services @@ -664,7 +722,7 @@ createLinksForBackCompatibility() { # The \n is needed, some /etc/services files are missing a trailing # line feed - MOD 7-Nov-2002 FileName=/etc/services - newLine="gds_db 3050/tcp # FirebirdSQL Database Remote Protocol" + newLine="gds_db 3050/tcp # Firebird SQL Database Remote Protocol" oldLine=`grep "^gds_db" $FileName` if [ -z "$oldLine" ] then diff --git a/builds/install/arch-specific/linux/classic/postuninstall.sh.in b/builds/install/arch-specific/linux/classic/postuninstall.sh.in index 3f528ad6a1..9472ab938e 100644 --- a/builds/install/arch-specific/linux/classic/postuninstall.sh.in +++ b/builds/install/arch-specific/linux/classic/postuninstall.sh.in @@ -1,6 +1,6 @@ #!/bin/sh # -# This library is part of the FirebirdSQL project +# This library is part of the Firebird project # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -31,7 +31,7 @@ # Contributor(s): # # -# $Id: postuninstall.sh.in,v 1.1 2003-07-08 22:59:57 brodsom Exp $ +# $Id: postuninstall.sh.in,v 1.2 2005-03-13 16:04:33 alexpeshkoff Exp $ # # The post uninstall routine for Firebird Classic. @@ -92,12 +92,42 @@ removeInetDService() { } +#------------------------------------------------------------------------ +# Delete new user and group + + +deleteFirebirdUser() { + + userdel firebird + # groupdel firebird + +} + +#------------------------------------------------------------------------ +# removeLinksForBackCompatibility +# Remove links for back compatibility to InterBase and Firebird1.0 +# linked systems. + +removeLinksForBackCompatibility() { + + if [ -L @libdir@/libgds.so ] + then + rm -f @libdir@/libgds.so + fi + if [ -L @libdir@/libgds.so.0 ] + then + rm -f @libdir@/libgds.so.0 + fi + +} + + #= Main PostUn ============================================================ # I don't think this is needed anymore. -# if [ -L /usr/lib/libgds.so ] +# if [ -L @libdir@/libgds.so ] # then -# rm /usr/lib/libgds.so +# rm @libdir@/libgds.so # fi if [ "$1"=0 ] @@ -111,6 +141,7 @@ removeInetDService() { #oldLine=`grep "^gds_db" $FileName` #removeLineFromFile "$FileName" "$oldLine" + removeLinksForBackCompatibility if [ -d /etc/xinetd.d ] then diff --git a/builds/install/arch-specific/linux/classic/preinstall.sh.in b/builds/install/arch-specific/linux/classic/preinstall.sh.in index f941867014..37bbfbee5a 100644 --- a/builds/install/arch-specific/linux/classic/preinstall.sh.in +++ b/builds/install/arch-specific/linux/classic/preinstall.sh.in @@ -31,7 +31,7 @@ # Contributor(s): # # -# $Id: preinstall.sh.in,v 1.4 2004-04-27 12:36:30 brodsom Exp $ +# $Id: preinstall.sh.in,v 1.5 2005-03-13 16:04:33 alexpeshkoff Exp $ # @@ -188,95 +188,6 @@ displayMessage() { } -#------------------------------------------------------------------------ -# Archive any existing prior installed files. -# The 'cd' stuff is to avoid the "leading '/' removed message from tar. -# for the same reason the DestFile is specified without the leading "/" - - -archivePriorInstallSystemFilesX() { - - oldPWD=`pwd` - archiveFileList="" - - cd / - - - DestFile="$FBRootDir" - if [ -e "$DestFile" ] - then - echo "" - echo "" - echo "" - echo "--- Warning ----------------------------------------------" - echo " The installation target directory: $FBRootDir" - echo " Already contains a prior installation of Firebird." - echo " This and files found in /usr/include and @libdir@ will be" - echo " archived in the file : ${ArchiveMainFile}" - echo "" - - if [ ! -z "$InteractiveInstall" ] - then - AskQuestion "Press return to continue or ^C to abort" - fi - - if [ -e $DestFile ] - then - archiveFileList="$archiveFileList $DestFile" - fi - fi - - - for i in ibase.h iberror.h ib_util.h - do - DestFile=usr/include/$i - if [ -e $DestFile ] - then - archiveFileList="$archiveFileList $DestFile" - fi - done - - for i in gds_pyxis.a gds.a libfbembed.so.@FIREBIRD_VERSION@ libfbclient.so.@FIREBIRD_VERSION@ libib_util.so libgds.a - do - DestFile=usr/lib/$i - if [ -e $DestFile ] - then - archiveFileList="$archiveFileList $DestFile" - fi - done - - for i in usr/sbin/rcfirebird etc/init.d/firebird etc/rc.d/init.d/firebird - do - DestFile=$i - if [ -e $DestFile ] - then - archiveFileList="$archiveFileList $DestFile" - fi - done - - if [ ! -z "$archiveFileList" ] - then - - displayMessage "Archiving..." - - runAndCheckExit "tar -czf $ArchiveMainFile $archiveFileList" - - - displayMessage "Done." - displayMessage "Deleting..." - - for i in $archiveFileList - do - rm -rf $i - done - - displayMessage "Done." - - fi - cd $oldPWD - -} - #------------------------------------------------------------------------ # Archive any existing prior installed files. # This is mainly for the .tar.gz install since rpm packages take care of @@ -357,8 +268,7 @@ EOF cd / for i in $deleteFileList do - echo $i - #rm -f $i + rm -f $i done cd $oldPWD @@ -366,8 +276,6 @@ EOF displayMessage "Done." fi - - } diff --git a/builds/install/arch-specific/linux/classic/preuninstall.sh.in b/builds/install/arch-specific/linux/classic/preuninstall.sh.in index 8046fc85a2..34b8bff715 100644 --- a/builds/install/arch-specific/linux/classic/preuninstall.sh.in +++ b/builds/install/arch-specific/linux/classic/preuninstall.sh.in @@ -31,7 +31,7 @@ # Contributor(s): # # -# $Id: preuninstall.sh.in,v 1.2 2005-02-24 12:23:02 alexpeshkoff Exp $ +# $Id: preuninstall.sh.in,v 1.3 2005-03-13 16:04:33 alexpeshkoff Exp $ # # The pre uninstall routines for Firebird Classic @@ -77,15 +77,16 @@ checkIfServerRunning() { FBRootDir=$FirebirdInstallPrefix FBBin=$FBRootDir/bin + SecurityDatabase=security2.fdb checkIfServerRunning cd $FBRootDir - if [ -f security2.fdb ] + if [ -f $SecurityDatabase ] then - cp security2.fdb /tmp - echo "Saved a copy of security2.fdb in /tmp" + cp $SecurityDatabase /tmp + echo "Saved a copy of $SecurityDatabase in /tmp" fi for i in isc_init1* isc_event1* isc_lock1* isc_guard* firebird.log SYSDBA.password diff --git a/builds/install/arch-specific/linux/classic/rpmheader.txt.in b/builds/install/arch-specific/linux/classic/rpmheader.txt.in index 4a820e70de..2838303713 100644 --- a/builds/install/arch-specific/linux/classic/rpmheader.txt.in +++ b/builds/install/arch-specific/linux/classic/rpmheader.txt.in @@ -4,7 +4,7 @@ Version: @FIREBIRD_VERSION@.@FB_BUILD_NUM@ Release: @FIREBIRD_PACKAGE_VERSION@ Copyright: Distributable Group: Applications/Databases -Source: FirebirdCS0.9src.tar.gz +Source: Firebird-@FIREBIRD_VERSION@.@FB_BUILD_NUM@.tar.bz2 URL: http://firebird.sourceforge.net # Prefix: / AutoReqProv: no diff --git a/builds/install/arch-specific/linux/misc/changeDBAPassword.sh.in b/builds/install/arch-specific/linux/misc/changeDBAPassword.sh.in index 3aa0940894..b8a1997f4c 100644 --- a/builds/install/arch-specific/linux/misc/changeDBAPassword.sh.in +++ b/builds/install/arch-specific/linux/misc/changeDBAPassword.sh.in @@ -1,8 +1,7 @@ #! /bin/sh -# This shell script changes both the SYSDBA user and the firebird -# install script (for SS installations). +# This shell script changes both the SYSDBA user #------------------------------------------------------------------------ # Prompt for response, store result in Answer @@ -25,60 +24,110 @@ AskQuestion() { changeInitPassword() { NewPasswd=$1 + DBAPasswordFile=$FBRootDir/SYSDBA.password InitFile=/etc/rc.d/init.d/firebird - if [ ! -f $InitFile ] + if [ ! -f $InitFile ] then - InitFile=/etc/init.d/firebird - fi - + InitFile=/etc/init.d/firebird + fi + if [ -f $InitFile ] then - ed $InitFile < $DBAPasswordFile + echo "" >> $DBAPasswordFile + + echo "ISC_USER=sysdba" >> $DBAPasswordFile + echo "ISC_PASSWD=$NewPasswd" >> $DBAPasswordFile + echo "" >> $DBAPasswordFile + + if [ $NewPasswd = "masterkey" ] + then + echo "# for install on `hostname` at time `date`" >> $DBAPasswordFile + echo "# You should change this password at the earliest oportunity" >> $DBAPasswordFile + else + echo "# generated on `hostname` at time `date`" >> $DBAPasswordFile + fi + echo "" >> $DBAPasswordFile + echo "# Your password can be changed to a more suitable one using the" >> $DBAPasswordFile + echo "# @prefix@/bin/changeDBAPassword.sh script" >> $DBAPasswordFile + + # Additional instructions for super server + echo "" >> $DBAPasswordFile + echo "# For superserver you will also want to check the password in the" >> $DBAPasswordFile + echo "# daemon init routine in the file /etc/rc.d/init.d/firebird" >> $DBAPasswordFile + + echo "" >> $DBAPasswordFile + chmod u=r,go= $DBAPasswordFile + +} + + +#------------------------------------------------------------------------ +# Generate new sysdba password - this routine is used only in the +# rpm file not in the install acript. generateNewDBAPassword() { - DBAPasswordFile=$IBRootDir/SYSDBA.password - NewPasswd=`mkpasswd -l 8` - echo "Firebird generated password " > $DBAPasswordFile - echo "for user SYSDBA is : $NewPasswd" >> $DBAPasswordFile - echo "generated on `hostname` at time `date`" >> $DBAPasswordFile - echo "" >> $DBAPasswordFile - echo "(For superserver you will also want to check the password in the" >> $DBAPasswordFile - echo "daemon init routine in the file /etc/rc.d/init.d/firebird)" >> $DBAPasswordFile - echo "" >> $DBAPasswordFile - echo "Your password can be changed to a more suitable one using the" >> $DBAPasswordFile - echo "@prefix@/bin/gsec program as show below:" >> $DBAPasswordFile - echo "" >> $DBAPasswordFile - echo ">cd @prefix@" >> $DBAPasswordFile - echo ">bin/gsec -user sysdba -password " >> $DBAPasswordFile - echo "GSEC>modify sysdba -pw " >> $DBAPasswordFile - echo "GSEC>quit" >> $DBAPasswordFile - chmod u=rw,go= $DBAPasswordFile + # openssl generates random data. + if [ -f /usr/bin/openssl ] + then + # We generate 20 random chars, strip any '/''s and get the first 8 + NewPasswd=`openssl rand -base64 20 | tr -d '/' | cut -c1-8` + fi - $IBBin/gsec -user sysdba -password masterkey < +# +# Contributor(s): +# +# +# $Id: changeGdsLibraryCompatibleLink.sh.in,v 1.1 2005-03-13 16:04:59 alexpeshkoff Exp $ +# + + +# This script allows the user to change the link on classic for the +# client library from +# +# a) libfbembed.so original classic direct connection +# b) libfbclient.so multithreaded client connection +# + +#------------------------------------------------------------------------ +# Prompt for response, store result in Answer + +Answer="" + +AskQuestion() { + Test=$1 + DefaultAns=$2 + echo -n "${1}" + Answer="$DefaultAns" + read Answer + + if [ -z $Answer ] + then + Answer=$DefaultAns + fi +} + + +#------------------------------------------------------------------------ +# remove Link + +removeLink() { + fileName=$1 + + if [ -L $fileName ] + then + rm -f $fileName + fi + +} + + +#------------------------------------------------------------------------ +# quitIfRealFile +# Remove the backward comparibility links for libgds.so + +quitIfRealFile() { + + fileToCheck=$1 + + # Don't worry about symbolic links + if [ -L $fileToCheck ] + then + return + fi + + if [ -f $fileToCheck ] + then + echo "The file $fileToCheck is a real file not just a link to an " + echo "existing file. It therefore may be from a" + echo "previous firebird or InterBase(r) installation" + echo "You will need to manually check the status of this file" + echo "and remove it before running this script again" + exit + fi +} + + +#------------------------------------------------------------------------ +# removeLinks +# Remove the backward comparibility links for libgds.so + +removeLinks() { + removeLink @libdir@/libgds.so + removeLink @libdir@/libgds.so.0 +} + + +#------------------------------------------------------------------------ +# createLinksForBackCompatibility +# Create links for back compatibility to InterBase and Firebird1.0 +# linked systems. + +createLinksForBackCompatibility() { + + # These two links are required for compatibility with existing ib programs + # If the program had been linked with libgds.so then this link is required + # to ensure it loads the fb equivalent. Eventually these should be + # optional and in a seperate rpm install. MOD 7-Nov-2002. + + newLibrary=$FBRootDir/lib/$1 + + removeLinks + + ln -s $newLibrary @libdir@/libgds.so + ln -s $newLibrary @libdir@/libgds.so.0 + + +} + +#------------------------------------------------------------------------ +# printStatus + +printStatus() { + printStatus=`ls -l @libdir@/libgds.so | sed 's@^.* /usr@/usr@'` + echo $printStatus + +} + + +#= Main ==================================================================== + + + FBRootDir=@prefix@ + FBBin=$FBRootDir/bin + +cat < +# +# Contributor(s): +# +# + + + +#------------------------------------------------------------------------ +# Prompt for response, store result in Answer + +Answer="" + +AskQuestion() { + Test=$1 + DefaultAns=$2 + echo -n "${1}" + Answer="$DefaultAns" + read Answer +} + + + +#------------------------------------------------------------------------------ +# appendAliasEntry +# check to see if an entry already exists in the aliases.conf file +# if it doesn't append it to the end of the file + +appendAliasEntry() { + aliasName=$1 + newDB=$2 + + # check if aliasName already exists + oldLine=`grep "^$aliasName" $AliasFile` + if [ -z $oldLine ] + then + # Create the alias file entry + echo "$aliasName = $newDB" >> $AliasFile + else + cat < " + exit + fi + + aliasName=$1 + newDB=$2 + + AliasFile=$FBRootDir/aliases.conf + + + checkNameStartsWithSlash $newDB + appendAliasEntry $aliasName $newDB + +# checkAccessToFile $newDB + + if [ ! -f $newDB ] + then + #source $FBRootDir/SYSDBA.password + $FBBin/isql </dev/null + ISC_USER=SYSDBA + ISC_PASSWORD=masterkey + $FIREBIRD/bin/fbmgr -shut -user $ISC_USER -password $ISC_PASSWORD 2>/dev/null unset ISC_USER unset ISC_PASSWORD # Remember status and be verbose rc_status -v ;; - try-restart) + try-restart) ## Stop the service and if this succeeds (i.e. the ## service was running before), start it again. ## Note: try-restart is not (yet) part of LSB (as of 0.7.5) @@ -120,7 +120,7 @@ case "$1" in # Remember status and be quiet rc_status ;; - restart|force-reload) + restart|force-reload) ## Stop the service and regardless of whether it was ## running or not, start it again. echo "Restarting service Firebird" @@ -130,10 +130,10 @@ case "$1" in # Remember status and be quiet rc_status ;; - reload) + reload) ;; - status) + status) echo -n "Checking for Firebird: " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. @@ -149,7 +149,7 @@ case "$1" in rc_status -v ;; - *) + *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" exit 1 ;; diff --git a/builds/install/misc/changeDBAPassword.sh.in b/builds/install/misc/changeDBAPassword.sh.in index 180114b594..91eee7d699 100644 --- a/builds/install/misc/changeDBAPassword.sh.in +++ b/builds/install/misc/changeDBAPassword.sh.in @@ -2,6 +2,7 @@ # This shell script changes both the SYSDBA user +# and /etc/init.d/firebird script #------------------------------------------------------------------------ # Prompt for response, store result in Answer @@ -24,12 +25,20 @@ AskQuestion() { changeInitPassword() { NewPasswd=$1 + DBAPasswordFile=$FBRootDir/SYSDBA.password InitFile=/etc/rc.d/init.d/firebird + if [ ! -f $InitFile ] + then + InitFile=/etc/init.d/firebird + fi if [ -f $InitFile ] then - ed $InitFile < $DBAPasswordFile - echo "for user SYSDBA is : $NewPasswd" >> $DBAPasswordFile - echo "generated on `hostname` at time `date`" >> $DBAPasswordFile - echo "" >> $DBAPasswordFile - echo "(For superserver you will also want to check the password in the" >> $DBAPasswordFile - echo "daemon init routine in the file /etc/rc.d/init.d/firebird)" >> $DBAPasswordFile - echo "" >> $DBAPasswordFile - echo "Your password can be changed to a more suitable one using the" >> $DBAPasswordFile - echo "@prefix@/bin/gsec program as show below:" >> $DBAPasswordFile - echo "" >> $DBAPasswordFile - echo ">cd @prefix@" >> $DBAPasswordFile - echo ">bin/gsec -user sysdba -password " >> $DBAPasswordFile - echo "GSEC>modify sysdba -pw " >> $DBAPasswordFile - echo "GSEC>quit" >> $DBAPasswordFile - - chmod u=rw,go= $DBAPasswordFile - - $IBBin/gsec -user sysdba -password masterkey < +# +# Contributor(s): +# +# $Id: fb_config.in,v 1.1 2005-03-13 16:02:12 alexpeshkoff Exp $ +# + +# stored configuration values + +fb_root=@prefix@ +fb_bindir=$fb_root/bin +fb_libdir=$fb_root/lib +fb_incdir=$fb_root/include + +fb_cflags="-I$fb_incdir" +fb_libs="-L$fb_libdir -lfbclient" +fb_embedlibs="-L$fb_libdir -lfbembed" + +BuildVersion=@FIREBIRD_VERSION@.@FB_BUILD_NUM@ +PackageVersion=@FIREBIRD_PACKAGE_VERSION@ +CpuType=@CPU_TYPE@ + +Version="$BuildVersion-$PackageVersion.$CpuType" + +fb_version=$Version + + +usage() { + cat <