Make the openerp-server a deamon

Registered by Joël Grand-Guillaume @ camptocamp

The openerp-server.py file already implement the --pidfile option, but it's not yet a real implementation of "deamon" process.

Processes usually become daemons by forking a child process and then having their parent process immediately exit, thus causing init to adopt the child process.

Why we don't implement a full deamon inside openerp-server.py ?! So we can "demonize" the process :)

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Joël Grand-Guillaume @ camptocamp
Direction:
Needs approval
Assignee:
None
Definition:
Drafting
Series goal:
Accepted for trunk
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

I would go a little further and ask that it'd not only daemonize, but also correctly fork/thread out.

For each database, a separate orm/osv/database connection daemon could fork out.
Then, each client could easily get a client daemon child process connecting to the orm/osv/db daemon for that db.

This way, OpenERP would become massively more scalable than it is today, without adding much complexity.
Not only that, but when a client goes away, it's child process would die, and so would it's used memory, which can become quite a problem in OpenERP servers.
The main orm/osv/db daemon would be much less memory 'leaky' and inherently more stable.

I think the easiest way for this would be to use the multiprocessing module, which is new in 2.6 but has been backported to 2.5, and is the only way ( I know of) to do this platform independently
Python 2.4 for OpenERP is horribly broken anyway, they should own up and drop support for it OR massively fix it.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.