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
!
via bash-shell per ssh you could use "nohup [yourcommand] > /dev/null 2>&1 &" then you'll be able to close the terminal without interrupting the process launched from within that ssh session. aside from that, you'll probably need some kind of init script, e.g. /etc/init.d/openerp - you can find some basic example here: http://pastie.org/6342884 - but it's for my debian machine and probably won't work with your system without modifications (e.g. my config file is located at /etc and so on). oh, and i just stumbled upon a thread down here: http://bit.ly/YAqyYi - it provides a script for ubuntu.
If you consider that your question has been answered it is a courtesy to those who answered to indicate which answer solved your problem.