DocCyblade / tkl-odoo

Turnkey Linux - Odoo v8 (Published v14.2)
https://www.turnkeylinux.org/odoo
GNU General Public License v3.0
21 stars 24 forks source link

v0.3 Beta - WIP Notes #1

Closed DocCyblade closed 9 years ago

DocCyblade commented 9 years ago

Modify Odoo build code to base install using TKLDec build standards. Keep extra bits that are removed to an archive folder.

l-arnold commented 9 years ago

Ken, Just posted on tkl-nomadic-odoo but the following gives an outline of the "control points" it seems we want to have in place (in terms of files)

I am not saying we should have the 'Connector" or "Magento-Connector" in the build. I do think we want to have the Init Scrips, Conf etc outlined in a similar manner to theirs.


copied from my (tkl-nomadic-odoo) post just now which comes from:

https://github.com/OCA/connector-magento/issues/148#issuecomment-143224408

Well thank you very much for your support, the jobrunner is working like a charm now!

For everyone who does not directly understand the howto, here are the steps that it took me to migrate to the jobrunner:

1) change workers setting in openerp-server.conf: my setting is now: workers = 10

2) change the startup script in /etc/init.d/odoo: add (choose whatever count fits best for you): export ODOO_CONNECTOR_CHANNELS=root:3 export ODOO_CONNECTOR_PORT=8069

and change the start-stop-daemon to: start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$USER --background --make-pidfile --exec $DAEMON -- --config $CONFIG --logfile $LOGFILE --load=web,connector

3) disable "Enqueue Jobs" cron: go to Settings->Automation->Scheduled Actions and deactivate Enqueue Jobs

4) update to 3.2.0 of OCA/connector

DocCyblade commented 9 years ago

Just an FYI, don't try and build from a WIP branch. If you build only build from a tagged commit. It should be safe to build from dev once first release v0.3 is tagged as it will be merged to dev

l-arnold commented 9 years ago

On this, I just was not getting "an up and running Odoo" with the Dev 02 Branch. Refering here to the tkl-nomadic-odoo b-dev (at beta 2) stage.

Simultaneous was dev-wip1 which I had thought would be same but last I looked had 16 files diff.

Have you gotten a "running" dev build (where Odoo Service and therefore Program is running after ISO install (b-Dev beta 2) ?

I will browse your code here.

DocCyblade commented 9 years ago

I should have a tagged release by end of the day today, I hope!

l-arnold commented 9 years ago

Excellent!

DocCyblade commented 9 years ago

Well so close, I have a build but need to squash some bugs. Throwing in the towel tonight but will work on it first thing Monday AM for a few hours. If I don't tag a release I'll at least push my local GIT repo for what I have so far

l-arnold commented 9 years ago

Sounds good Ken. Guessing if you compare dev to dev-wip1 on tkl-nomadic-odoo perhaps some variance will show itself.

Put a lot of wotk into tagging useful OCA modules today (50-external-modules) in dev-wip1

Prob too many but very interesting sets.

DocCyblade commented 9 years ago

@l-arnold

I did not get up as early as planned! I did an ISO install and saw that odoo does not want to start. I think I may have this fixed. It seems the pid file and some other little things are causing the odoo service not to start. I am building an ISO now to test. Maybe v0.3 some time today?

DocCyblade commented 9 years ago

I confirmed the issue were odoo was not running after reboot. It seems the pid file ownership keeps changing to root. If I change it back to openerp it starts to work once I start the service.

Need to see why systemctl keeps changing the pid ownership. Maybe it's recreating the file?

DocCyblade commented 9 years ago

After some quick research, the command that is starting and stopping the service start-stop-daemon more info here is creating and deleting the pid file. Odoo has the ability to create and maintain its own pid file so we may need to change the startup script to exclude managing the pid file.

I'll test this tonight

DocCyblade commented 9 years ago

@JedMeister what say you regarding pid files? Should the startup script manage it or should the script it's self? It seems that odoo can do both, just a config issue. Would like to know your thoughts on the subject

l-arnold commented 9 years ago

Nice work Ken. I was finding similar with various start stop possibilities... But did not get to the pid file per say. Would seem you could su - openerp to issue the commands and it would be in line with Odoo.

JedMeister commented 9 years ago

@DocCyblade - TBH I'm not sure what would be best (or if it even matters). Historically (with SysVinit) it was important for the init system to be aware of the PID (so the PID file needed to be handled by the init script). However since SystemD it's not so important. AFAIK it is still recommended that the init system being aware of the PID it isn't actually necessary. Having said that, the init script is actually a SysV init script (still handled by SystemD) and TBH I'm not clear on how that backwards compatibility works...

So long story short I'm not even clear that it matters at this point. So long as it works I'll be happy! :smile:

DocCyblade commented 9 years ago

@JedMeister I feel like I just went for a ride on a spinning marry go round... But it was a fun ride (Read that to be funny :smile: ) Just had good laugh after reading, but in a good way. After closer look, I have in the config file a PID location. The python script looks like it's trying to manage the file.

What I think is going on is, the start-stop-daemon is being called with a few options that are deleting and creating the PID file, Odoo is trying to manage it too. So when it tries to start, Odoo can't access the file as the the owner and group permissions have changed back to root. I think I read some where that Odoo can spawn threads of it's own, so I don't know if that means we should let Odoo manage the PID file.

I am going to test this by setting permissions back to openerp and and remove the --make-pidfile option in the init script and make sure the openerp-server.conf file has the correct pid file selected. I'll report back later

On the subject, I think I will take a look at systemd docs and see how to "correctly" setup a service natively as this is the new direction.

JedMeister commented 9 years ago

@DocCyblade - Hehe, yep! I just re-read my post and I totally get how it may have read...

Re a systemd init script: If you do create a systemd service init file that's ok but we'll still need a sysvinit script (as well). This is because the container builds (LXC, OpenVZ, etc) all require sysvinit. This is because systemd doesn't play nice inside a container in Jessie - we'll be fine for v15.x though as apparently the bug is resolved in Stretch already.

DocCyblade commented 9 years ago

@JedMeister Good you share my humor...

Sounds good, I am going to let the init script run with this one, am making the changes now in a already built and installed Odoo system to see the results. Usually you have to putz around with service to get to start. We will see where this goes. I'll post a few

l-arnold commented 9 years ago

Sounds Like a Plan Ken. Just lost my longer note as to why on the subject but I feel this is most consistent with Odoo Land and if all goes well there will be quite a few coming in from that space. Really important that the Server can Start/Stop/Restart and UPDATE as expected without reboots.

thanks for working on this.

DocCyblade commented 9 years ago

@JedMeister Looks like I was right about the PID file, seems things are working now. I am making changes to the build code, going to do a full ISO and install to test. If all goes well. We will have v0.3 I am sure there will be bugs.

l-arnold commented 9 years ago

My lost note was on my phone here.

Sounds like a good plan and direction Ken. I would try to keep things as Normal to Odoo as possible.

I think it would be best if we could start/stop/restart Odoo server / services and update via /etc/init.d/openerp.server . Ideally the standard Sevives call would address the system the same way. I recommend also a softlink to the init.d file to be within /opt/odoo as well.

Most people come at Odoo in theae ways and itvwould be good to have their toolset also work with ours.

Ideally. All methods of inducing would work.

JedMeister commented 9 years ago

@DocCyblade - great work mate! :smile:

@l-arnold - I don't think that there is any need to include a link to the init script in the odoo directory. The init script does not come from the git repo so I don't really see the point TBH. If you think that Odoo users may have an interest in adjusting the init script (TBH I do not see why they would) we could always just document it...

l-arnold commented 9 years ago

@JedMeister I think the issue is that "normal start stop functions" work somehow or another. (UPDATED SLIGHTLY) In my testing so far I've been able to stop consistently but only been able to restart reliably with the sysctl (spell?) type command or via full restart. Concern there is that several variables need to be controlled via the traditional means. Going to /etc/init.d certainly works but it has often seemed that there are 2 different "service-hooks" being called that worked differently.. Probably Ken's current changes will fix.

Being able to -u (update) a database is also quite important. Not clear that the systctl (spell?) approac worked that way. Somewhat complicated to check as would need to have a database that clearly had an earlier structure and need to match a later structure. Would need an Odoo or Module Change of this type to really test it.

Assuming Root can run the commands, but OK by me if su-openerp is required.

I am a broken record I know. Sorry about that.

DocCyblade commented 9 years ago

Closing since #3 is complete