[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Placing mysql install script (webapps-common with dbconfig-common)



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Sean and others,

I'm using webapps-common to package phpesp (a set of php scripts for
online surveys). Since updating to webapps-common 0.8 (rev. 111), I've
noticed that the mysql install script location has changed. It used to be
/usr/share/dbconfig-common/data/<packagename>/install/mysql
but now it is
/usr/share/dbconfig-common/data/<WC_INSTANCE>/install/mysql
where WC_INSTANCE is something like =global=/phpesp or whereever the user
has configured the webapp to be living. I understand something like this
is necessary in order to support multiple instances of the same app
running on a server. My question is, how do I (in the postinst script)
find out WC_INSTANCE?
I currently use
db_get phpesp/httpd/instances || {
  echo "Website directory not found" >&2
}
WC_INSTANCE="$RET"
but this only works if there is only one instance (well, I could loop over
all configured instances, no problem). It would be nice if there would be
a
documented 'wc_instances' environment variable I could use for this.

Another reason this is needed is that phpesp needs to know its base URL,
or actually, the 'website_subdirectory' question asked during package
configuration. There are several scripts in several locations that link to
each other with <a href=...> tags in the generated html. The protocol and
hostname parts can be determined dynamically, but the base directory
cannot (without storing the location of each script in the scripts
themselves). So now I use
WC_DIRECTORY="`echo $WC_INSTANCE | cut -sd/ -f2- | sed -e 's,^/,,'`"
to strip off the host part and get to the website subdirectory. Maybe
that's not the nicest way to get to the subdirectory either - is there a
better way?

Thanks for your work on webapps-common up to now!

Cheers

Jan-Pascal

PS: Subversion repository of the phpesp package is at
http://svn.vanbest.org/svn/phpesp/trunk/ ; websvn at
http://www.vanbest.org/websvn/listing.php?repname=phpesp&path=%2Ftrunk%2Fdebian%2F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGVUIOOkyycBqJzCMRAo3MAKCdT7hN6Vib8qU+E12yMIzgcrEHcACcDplU
kx96xGZ//yyDMseG+aN1ofs=
=Bkl6
-----END PGP SIGNATURE-----




Reply to: