Hi Sean, sean finney wrote: > hi jan, > > On Thursday 24 May 2007 09:43, Jan-Pascal van Best wrote: > >> /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 >> > > eek, that's actually an unintended sideeffect. i wonder why i didn't see it > in my testing... there's probably going to be a few more like this too. > > for configuration-related stuff the layout should be something like > package/instance/configfile, but for the bootstrapping sql and other > instance-independant info, the instance shouldn't be appended at all. > I think it is - maybe each instance needs its own admin password (like phpesp does). In general, you wouldn't want all instances to share the same (default) password. Maybe allow both ways? The instance should be some identifier, though, and not the web location where the instance is installed: if, later, the instance is moved using dpkg-reconfigure, and after that an update need additional sql, where should that sql be placed? In the old or in the new location? An identifier (a name, an auto-incrementing number, or even some random number) looks better to me. >> 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? >> > > currently there isn't an easy way, though i agree there ought to be. it'd > help to have a picture of some of the use cases for it, so i don't go > designing a tool that meets the wrong needs... > Well, phpesp is one use case. Maybe advertise on debian-devel for more guinea pigs? >> 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? >> > i think we may need a webapps-common tool like the dbconfig-generate-include > tool from dbconfig-common... > That sounds great - but how would that work in the multi-instance case? I think the include file name should also be a template, and that {db,wc}config-generate-include should fill in the instance ID for each of the configured instances. Enough to cause headaches... Cheers Jan-Pascal > > sean >
Attachment:
signature.asc
Description: OpenPGP digital signature