Landis Arnold's picture

I have been drafting a OpenERP App which can be found a the following location.

 https://github.com/l-arnold/postgresql---openerp

It is based on the basic way I built my running ap.  There are a few "moves" involved wich I am unclear on the scripting of.

  • I am assuming I don't use apt-get for some "apt-gets" in (conf.d/main)
  • There are several Python Library Pulls (conf.d/main)
  • There are some bzr branch pulls (hopefully run after bzr is actually brought in
  • There is a New User Declaration for Postgres and also SSH (su - )  (inside conf.d/downloads)
  • There is a Start Script Creation (should likely move into a configuration/auto start system soon) that is run under su - (non root)
  • In general I feel I need to get my hands around how the sequencing of calls will work in TKLDEV.
  • Any and all recomendations / help is appreciated.

In Points of focus, I branched this from PostgreSQL.  I added the File "Downloads" in conf.d (as I saw downloads in some other App builds.  I have no idea what may call the download file and when sequentially.  Moreover I put some "generally sequential script elements" into the file and I expect they should go somewhere else.

I have not actually run anything as I am sure I need to clean this up some.

thanks in advance,

Landis (L. Arnold)

 

Forum: 
Jeremy Davis's picture

And I'm going to assume that you are further along than you were when you started this?!

Regardless, here are some comments on your questions (you may have worked it out but others might be looking for answers...). To be clear though, I am certainly no TKLDev expert...

I am assuming I don't use apt-get for some "apt-gets" in (conf.d/main)

Packages are generally installed by the plan (requires package name only) rather than apt-get in the conf.d (which it looks like your all over). Exceptions to that might be when you are installing from a non-default repo (i.e. not Debian stable or TKL).

There are several Python Library Pulls (conf.d/main)

Not sure what you mean by this...

There are some bzr branch pulls (hopefully run after bzr is actually brought in

The plan runs first so bzr should be installed fine by the time you start pulling down from version control...

There is a New User Declaration for Postgres and also SSH (su - ) (inside conf.d/downloads)

From a brief glance your conf.d/downloads looks fine... (But I didn't look carefully)

There is a Start Script Creation (should likely move into a configuration/auto start system soon) that is run under su - (non root)

I don't know about OpenERP but often software that needs to be run as a service (in Windows speak) can be started with a init script. If OpenERP can do that then I suspect that would be the go... Then you could just put that in the overlay.

In general I feel I need to get my hands around how the sequencing of calls will work in TKLDEV.

AFAIK it's Something like this:

  1. install packages listed in plan
  2. apply overlay files
  3. run conf.d scripts (in order; so 'downloads' will run before 'main', etc)

FWIW I'm not sure on the rationale of splitting conf.d into downloads and main, but from what i can see of what Alon and Liraz have done, is downloads is simply that... It downloads what ever files are needed. Then main actually does stuff to them (like unpacking them, moving them, deleting them when done, etc)

Hope that's of some help...

Landis Arnold's picture

I will try to parse this even today.  A few questions (driftin into statements) still.

  • Does the new "Downloads" file get called by a command or by its presense does it get called implcitly?   There are other Aps (like Magento) with a Downloads file, so I made one too.
  • The "Python Library Pulls" are Python Library Elements that are required by OpenERP and therefore need to be installed before OpenERP is built and run.  This is likely OK. Just have to try.
  • Does BZR actually run in TKLDEV Ap, or am I only throwing BZR commands into the built by TKLDEV Ap where they will get called by the Ap itself?  (both would work, though the former would seem the TKL way).  How can I preconfigure so that the new USER can issue BZR Pull commands (having at start up a syncronized folder) so he/she can update to current software versions?  Ideally this could be commanded from WebMin even  (ok off the scale of fair questions).
  • In terms of building a Custom Script to Launch OpenERP I should look a bit at how Apache itself is called in other Aps.  Apache runs under a different User as OpenERP should. (for clarification - Apache itself will not be used or installed by this build )
  • I should also be careful of how the Port for OpenERP is called.  The aforementioned Script claims the Port now (in my own build) but I don't "claim it first".  In my draft I claimed the Port along with some others.  I won't know till trying but that may cause some sort of a collission.
  • InitHooks sounds fun.  I haven't really gone into there yet but sounds like I need to.

Thanks again.

(its difficult to put space between either numbered questions or bullet points w/ this formatting)

Jeremy Davis's picture

Does the new "Downloads" file get called by a command or by its presense does it get called implcitly?   There are other Aps (like Magento) with a Downloads file, so I made one too.

All the files in conf.d will get called (in sequential order) by TKLDev when you run 'make'. So you could make an additional file in conf.d called "more-stuff" and it would be run too (after main because of the order...). I think though that the files need to be executable (although I'm not 100% sure on that and haven't checked...

The "Python Library Pulls" are Python Library Elements that are required by OpenERP and therefore need to be installed before OpenERP is built and run.  This is likely OK. Just have to try.

I reckon they should be fine, but like you say, give it a go and see what happens! :)

Does BZR actually run in TKLDEV Ap, or am I only throwing BZR commands into the built by TKLDEV Ap where they will get called by the Ap itself?  (both would work, though the former would seem the TKL way).  How can I preconfigure so that the new USER can issue BZR Pull commands (having at start up a syncronized folder) so he/she can update to current software versions?  Ideally this could be commanded from WebMin even  (ok off the scale of fair questions).

bzr will be installed into your OpenERP appliance. The appliances are built in a chroot so while TKLDev is building the appliance stuff can be installed (and used) without actually being installed in the TKLDev host. Does that answer your question?

As for the user being able to issue bzr pulls, as bzr is installed in the appliance that shouldn't be an issue. I'm not clear on the purpose of the user being able to issue bzr pulls, is that to update? If you want the OpenERP user to be able to issue commands then you probably want to use the 'su' command from root.

In terms of building a Custom Script to Launch OpenERP I should look a bit at how Apache itself is called in other Aps.  Apache runs under a different User as OpenERP should. (for clarification - Apache itself will not be used or installed by this build )

Apache uses a different process as by default it uses 'privileged' ports (i.e. 80 & 443). These ports are only allowed access by root. It is complicated (and I don't 100% fully understand it myself) but basically to avoid Apache running as root but also being allowed access to privileged ports it does a bit of trickery...

So rather than confusing yourself on how Apache works (when it's not quite relevant anyway) I suggest you read up on how the Debian system launches programs on boot.

I should also be careful of how the Port for OpenERP is called.  The aforementioned Script claims the Port now (in my own build) but I don't "claim it first".  In my draft I claimed the Port along with some others.  I won't know till trying but that may cause some sort of a collission.

As I briefly mentioned above, privileged ports can only be opened by root. So if OpenERP is running as a non-privileged user (as I imagine it will be) and you don't have a webserver of some sort internal proxy access to OpenERP then you will need to think about how you will make OpenERP easily accessible. One option (other than webserver proxying) would be firewall rerouting of ports. I don't think that would be a recommended way of doing it though as by default the firewall is disabled on TKL.

InitHooks sounds fun.  I haven't really gone into there yet but sounds like I need to.

Not to be confused with Debian init scripts! :) But yes inithooks are pretty cool! You'll need to work them out for setting passwords etc...

Good luck! :)

Add new comment