From cca71f50d225f7829cd5f1539338fa678225bd91 Mon Sep 17 00:00:00 2001 From: Will Andrews Date: Sat, 10 Mar 2001 20:32:33 +0000 Subject: Add firebird 0.9, the open-source InterBase(tm) 6.0 spin-off (Classic version). PR: 24313 Submitted by: Geoffrey C. Speicher --- databases/firebird-devel/scripts/addservice | 9 ++++ databases/firebird-devel/scripts/createuser | 50 ++++++++++++++++++ databases/firebird-devel/scripts/post-install | 76 +++++++++++++++++++++++++++ databases/firebird-devel/scripts/pre-build | 15 ++++++ databases/firebird-devel/scripts/pre-install | 20 +++++++ databases/firebird-devel/scripts/rmservice | 8 +++ 6 files changed, 178 insertions(+) create mode 100644 databases/firebird-devel/scripts/addservice create mode 100644 databases/firebird-devel/scripts/createuser create mode 100644 databases/firebird-devel/scripts/post-install create mode 100644 databases/firebird-devel/scripts/pre-build create mode 100644 databases/firebird-devel/scripts/pre-install create mode 100644 databases/firebird-devel/scripts/rmservice (limited to 'databases/firebird-devel/scripts') diff --git a/databases/firebird-devel/scripts/addservice b/databases/firebird-devel/scripts/addservice new file mode 100644 index 000000000000..df9aea5e91de --- /dev/null +++ b/databases/firebird-devel/scripts/addservice @@ -0,0 +1,9 @@ +#!/bin/sh + +cat >>/etc/services <>/etc/inetd.conf < ) { + print "\nYou must be root to run this step!\n\n"; + exit 1; +} + +if( getpwnam( "firebird" ) ) { + ( $null, $null, $fbUID ) = getpwnam( "firebird" ); +} else { + $fbUID = 90; + while( getpwuid( $fbUID ) ) { + $fbUID++; + } +} + +if( getgrnam( "firebird" ) ) { + ( $null, $null, $fbGID ) = getgrnam( "firebird" ); +} else { + $fbGID = 90; + while( getgrgid( $fbGID ) ) { + $fbGID++; + } + &append_file( "/etc/group", "firebird:*:$fbGID:" ); +} + +print "firebird user using uid $fbUID\n"; +print "firebird user using gid $fbGID\n"; + +system( "/usr/bin/chpass -a \"firebird:*:$fbUID:$fbGID\:\:0:0:Firebird pseudo-user:$ENV{'PREFIX'}/firebird:/bin/sh\"" ); + +sub append_file { + local($file,@list) = @_; + local($LOCK_EX) = 2; + local($LOCK_NB) = 4; + local($LOCK_UN) = 8; + + open(F, ">> $file") || die "$file: $!\n"; + while( ! flock( F, $LOCK_EX | $LOCK_NB ) ) { + exit 1; + } + print F join( "\n", @list) . "\n"; + close F; + flock( F, $LOCK_UN ); +} diff --git a/databases/firebird-devel/scripts/post-install b/databases/firebird-devel/scripts/post-install new file mode 100644 index 000000000000..e4d2d3a9cd07 --- /dev/null +++ b/databases/firebird-devel/scripts/post-install @@ -0,0 +1,76 @@ +#!/bin/sh + +chown -R firebird:firebird $PREFIX/firebird + +# Turn everybody to read only. +chmod -R o=r $PREFIX/firebird + +# Now fix up the mess. + +# fix up directories +for i in `find $PREFIX/firebird -print` + do + FileName=$i + if [ -d $FileName ] + then + chmod o=rx $FileName + fi + done + + + +cd $PREFIX/firebird/bin + +# all users can run everything. +chmod o=rx * + +# SUID is needed for running server programs. + +for i in gds_lock_mgr gds_drop gds_inet_server + do + chmod ug+s $i + done + + +# Lock files + +cd $PREFIX/firebird + +for i in isc_init1 isc_lock1 isc_event1 + do + FileName=$i.`hostname` + touch $FileName + chmod uga=rw $FileName + chown firebird:firebird $FileName + done + + +touch interbase.log +chmod ugo=rw interbase.log + +# make databases writable by all +chmod ugo=rw examples/v5/*.gdb +chmod ugo=rw help/*.gdb +chmod ugo=rw isc4.gdb + +# remove any existing gds service +sh $SCRIPTDIR/rmservice + +# add the gds service and restart inetd +sh $SCRIPTDIR/addservice +kill -HUP `cat /var/run/inetd.pid` + +sed "s|%%PREFIX%%|$PREFIX|" $SCRIPTDIR/../pkg-message + +cat </etc/services.new +cat /etc/inetd.conf |grep -v gds_db >/etc/inetd.conf.new +mv /etc/services.new /etc/services +mv /etc/inetd.conf.new /etc/inetd.conf -- cgit v1.2.3