WebFaction
Community site: login faq

Hi I've installed OpenErp 6.1 on my account. When I started manually it runs ok, but how can I configured it not to close ? When I close ssh session it end the server

I try with cron but when it doesn't work, i've a starting script(~/webapps/openerp/start.sh):

.bash_profile

openerp-server -c /home/marianodan/webapps/openerp/server.conf

and configure cron like this:

*/1 * * * * ~/webapps/openerp/start.sh
This question is marked "community wiki".

asked 10 Dec '12, 07:02

Mariano a
112
accept rate: 0%

edited 10 Dec '12, 11:53

seanf
12.2k41836


If you would like to start the app in a SSH session and keep it running after you log out, you can do so by running as a background task via nohup, like this:

nohup /home/marianodan/bin/openerp-server -c /home/marianodan/webapps/openerp/server.conf >> /home/marianodan/logs/user/openerp.log 2>&1 &

Regarding your start.sh script, please try the following instead:

#!/bin/bash
/home/marianodan/bin/openerp-server -c /home/marianodan/webapps/openerp/server.conf

Hope that helps!

permanent link

answered 10 Dec '12, 11:52

seanf
12.2k41836
accept rate: 37%

Thanks thats solve it!

(22 Dec '12, 00:05) Mariano a

Just as a note, the best way top nohup a process is to redirect input and output and also run it in a subshell so it's disowned by the parent terminal (nohup traps SIGHUP but does not disown a process).

For instance:

(nohup $HOME/bin/myprogram < /dev/null &) 1> $HOME/tmp/myprogram.log 2>/dev/null
permanent link

answered 22 Dec '12, 01:41

ryans ♦♦
5.0k93160
accept rate: 43%

Another approach to this problem is to use screen.

Screen is a window-manager-of-sorts for the command line. It's a program designed to help you manage applications which run persistently on the server.

For now, just learn the following commands:

  • type "screen -S myscreen" to start a screen session with the name "myscreen".

  • run your command

  • type "Ctrl-a", then press "d" to disconnect. You have "disconnected" from the running screen session. But it is still there on the server, going.

type "screen -list" to see a list of sessions. It should show one named "myscreen".

type "screen -d -r myscreen" to re-attach to this screen session.

More interesting commands exist too:

When inside of screen, you can type "Ctrl-a", then "c" to create a new screen window inside of the same session. Then use "Ctrl-a", then "n" to go to the "next window", and use this to alternate windows. You can still detach from the session using "Ctrl-a, d", and you can simply quit one of the windows using the normal "Ctrl-d"; the other concurrent window will still persist.

To kill a screen session completely, attach to it and then "Ctrl-d" all of the windows it contains.

For more information on screen, see the manual: http://www.gnu.org/software/screen/manual/screen.txt

Hope that helps!

permanent link

answered 22 Dec '12, 01:43

ryans ♦♦
5.0k93160
accept rate: 43%

Another approach is to create a watchdog script which runs on cron, and only starts your process if it's not running.

This is probably the most robust approach, and is described in this related community post.

permanent link

answered 22 Dec '12, 01:44

ryans ♦♦
5.0k93160
accept rate: 43%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×103
×81
×57
×54
×4

question asked: 10 Dec '12, 07:02

question was seen: 2,867 times

last updated: 22 Dec '12, 01:44

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM