Warning, file /sdk/codevis/thirdparty/soci/scripts/vagrant/firebird.sh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #!/usr/bin/env bash
0002 # Part of Vagrant virtual development environments for SOCI
0003 
0004 # Installs PostgreSQL with 'soci' user and database
0005 # Pre-installation
0006 source /vagrant/scripts/vagrant/common.env
0007 export DEBIAN_FRONTEND="noninteractive"
0008 # FIXME: these debconf lines should automate the Firebird config but do/may not :(
0009 # However, keep them enabled to allow smooth(er) apt-get/dpkg operations.
0010 # Othwerise, installation of firebird packages may fail, randomly.
0011 # We work around this bug with Expect script below used to update SYSDBA password.
0012 sudo debconf-set-selections <<< "firebird2.5-super shared/firebird/enabled boolean true"
0013 sudo debconf-set-selections <<< "firebird2.5-super shared/firebird/sysdba_password/first_install password masterkey"
0014 # Installation
0015 sudo apt-get -o Dpkg::Options::='--force-confnew' -y -q install \
0016   expect \
0017   firebird2.5-super
0018 # Post-installation
0019 FB_ORIGINAL_PASS=`sudo cat /etc/firebird/2.5/SYSDBA.password \
0020   | grep ISC_PASSWORD | sed -e 's/ISC_PASSWORD="\([^"]*\)".*/\1/'`
0021 echo "Firebird: dpkg-reconfigure resetting sysdba password from ${FB_ORIGINAL_PASS} to ${SOCI_PASS}"
0022 export DEBIAN_FRONTEND="readline"
0023 # Expect script feeding dpkg-reconfigure prompts
0024 sudo /usr/bin/expect - << ENDMARK > /dev/null
0025 spawn dpkg-reconfigure firebird2.5-super -freadline
0026 expect "Enable Firebird server?"
0027 send "Y\r"
0028 
0029 expect "Password for SYSDBA:"
0030 send "${SOCI_PASS}\r"
0031 
0032 # done
0033 expect eof
0034 ENDMARK
0035 # End of Expect script
0036 export DEBIAN_FRONTEND="noninteractive"
0037 echo "Firebird: cat /etc/firebird/2.5/SYSDBA.password"
0038 sudo cat /etc/firebird/2.5/SYSDBA.password | grep ISC_
0039 echo
0040 echo "Firebird: creating user ${SOCI_USER}"
0041 sudo gsec -user sysdba -pass ${SOCI_PASS} -delete ${SOCI_USER}
0042 sudo gsec -user sysdba -pass ${SOCI_PASS} -add ${SOCI_USER} -pw ${SOCI_PASS} -admin yes
0043 echo "Firebird: creating database /tmp/${SOCI_USER}.fdb"
0044 sudo rm -f /tmp/${SOCI_USER}.fdb
0045 echo "CREATE DATABASE \"LOCALHOST:/tmp/${SOCI_USER}.fdb\";" \
0046   | isql-fb -q -u ${SOCI_USER} -p ${SOCI_PASS}
0047 echo "Firebird: restarting"
0048 sudo service firebird2.5-super restart
0049 echo "Firebird: DONE"