Odoo Help

2

2
3 Answers
6
app Portugal
2/27/13, 11:53 AM

If you're on Ubuntu, you can use an Upstart configuration file to autostart and manage your OpenERP instance.

Assuming you have a system user called "openerp", the following should work:

description "OpenERP 7.0"

start on runlevel [2345]
stop on runlevel [!2345]

respawn

exec su -s /bin/sh -c 'exec "$0" "$@"' openerp -- /opt/openerp/server/openerp-server -c /opt/openerp/config-server70.cfg --logfile=/opt/openerp/openerp-7.0.log $@

Adjust the config and log paths as you wish, and then save this in as /etc/init/openerp.conf.

Then, it will not only be automatically started on boot - as restarted if it dies, due to the respawn directive -, but you can also run restart openerp, stop openerp, etc instead of having to manually find the pid and kill it.

P.S.: The whole su -s /bin/sh -c exec ... is an Upstart "trick" to make OpenERP run as the "openerp" user, otherwise it would run as root!

3 Comments
Greg Boban United States
6/15/13, 7:57 PM

Thank you for the great tip. Don't forget to enable Upstart for all users, which is done in Upstart1.8 by: 1. Uncomment "ubuntu" in file /etc/upstart-xsessions. 2. Logout of any desktop sessions. 3. Login to the default Unity session.

Also, I modified the code slightly to get it to work:

description "OpenERP 7.0"

start on runlevel [2345] stop on runlevel [!2345]

respawn

exec su -s /bin/sh -c 'exec "$0" "$@"' openerp -- /opt/openerp/v7/server/openerp-server -c /etc/openerp-server.conf --logfile=/opt/openerp/openerp-7.0.log $@

Daniel Reis Portugal
9/6/13, 12:59 PM

Tip to troubleshoot: sudo bash /etc/init/openerp.conf

MONK Software, Leonardo Donelli Italy
1/7/14, 6:35 AM

Since Upstart 1.4, instead of the whole su -s /bin/sh ... ordeal, you can just use setuid <user you want to start openerp as> e.g. setuid openerp

0
Avatar

Martin Canada

--Martin--

2068
| 6 6 10
Cornwall, Canada
--Martin--

Analysing, designing, coding and mentoring since 1975. Kilobytes to terabytes. Punch cards to punchy sites. My OpenERP video series: http://www.youtube.com/playlist?list=PLq7op4J183lX44ZlXPiHxUpRvmmRDtxye My Google Speadsheets --> OpenERP Data Pump project: http://martinhbramwell.github.io/GData_OpenERP_Data_Pump My email (with spaces removed) : mhb . warehouseman @ gmail . com

Martin Canada
2/26/13, 6:10 PM

If you want a simple fix, just run the same command you were using and append the ampersand & after it, like this :

/opt/openerp/server/openerp-server &

That tells the server you want it to fork the command into an independently running (background) process. To bring it back to the foreground, just type fg.

fg

You don't indicate which operating system you are using, but this guide got me going immediately on an Ubuntu Precise Pangolin VPS . . .

http://www.theopensourcerer.com/2012/12/how-to-install-openerp-7-0-on-ubuntu-12-04-lts/

. . . &/or (if that is still broken) this too . . .

https://accounts.openerp.com/forum/Help-1/question/2562/

With one of those you ought to be able to reboot your VPS, and have it come back up with PostgreSQL and OpenERP ready to user without further intervention.

2 Comments
Alemu Ethiopia
6/20/13, 6:10 AM

plse anybody know how to autostart the openerp server on the Debian operating system.

Jagdish Panchal India
1/6/14, 2:51 AM

@Alemu :I have facing same prolem

0
Avatar

Daniel Reis Portugal

--Daniel Reis--
3976
| 8 9 11
Linda-a-Velha, Portugal
--Daniel Reis--

Author of the "Odoo Development Essentials" book.

Applications Manager at Securitas Portugal

Github: https://github.com/dreispt

Twitter; @reis_pt


Daniel Reis Portugal
9/6/13, 1:12 PM

It's possible to keep your SSH sessions alive and running even if you disconnect from them For that use screen or byobu (Byobu runs on top of screen but provides additional features).

You can shut-down your laptop at the office, turn it on at home, and reconnect to the sessions you left running, and everything will be there just as you left them!

1 Comment
Jagdish Panchal India
1/6/14, 2:06 AM

@Daniel Reis: I have start my opener server using screen command but when i reboot my server, openerp server stop. is there any solution related this command pls help

Ask a Question
Writer
Keep Informed
0 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now