Which is the best way to run rhoconnect in background mode?

Hi,

we have a rhoconnect installation in a Linux based machine, we use to start rhoconnect as seen in the documentation:

   # rhoconnect start

We do this from a PC to server by a ssh session. In this way, the terminal receives all logs and "puts". But if the connection from PC to Server is lost, we don't have a way to see if it is working fine. We hope that the same traces shown in terminal are stored in a log file, but we don't know where it is.

How can we run rhoconnect in background? And, where are the rhoconnect logs?

Best regards,

Oesía Project

Darryn Campbell
In your app you would be

In your app you would be having a folder named "rhosimulator"...under that folder you can view "rholog.txt".

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Oesia Project
Divyansh,in the Rhoconnect

Divyansh,

in the Rhoconnect application there is no rhosimulator folder, I tried to find all files with .log and .txt extensions and no one registers the output. The file that you refers can be found in the mobile applications, on client-side. Rhoconnect is executed on server-side.

Thanks,

Oesía Project

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Divyansh Madan
try this link and scroll down

try this link and scroll down to get the info and see if this helps...

http://docs.rhomobile.com/rhoconnect/tutorial

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Alexander Babichev
You should run rhoconnect app

You should run rhoconnect app like

$ rhoconnect start 2>&1 > /tmp/rhoapp.log

In that case all messages go to /tmp/rhoapp.log file. Later you can easily see it from remote console

$ tail -f /tmp/rhoapp.log

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Juan-Antonio Ma...
This actually redirects both

This actually redirects both stdout and stderr to a file, but does not execute the process in background as was required.

Just append a & to the end of the line to make it do:

$ rhoconnect start 2>&1 > /tmp/rhoapp.log &

This will overwrite log file everytime it is executed. To append data to any previously existing log, just replace > with >> :

$ rhoconnect start 2>&1 >> /tmp/rhoapp.log &


Problem is when you want to end the process.

You will have to run some ps -ef | grep rhoconnect , get the pid of it and then send it a kill message, kill <pidnumber>, assuming rhoconnect is "capturing" kill message. If this does not work, kill -9 <pidnumber> performs a forced shutdown.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Oesia Project
Hi Juan Antonio and Alexander

Hi Juan Antonio and Alexander and thanks for your comments, but ...

what we need is to run rhoconnect without terminal, like a "service" or like running with "nohup".

When we leave shell-script terminal executing:

  $ rhoconnect start 2>&1 >> /tmp/rhoapp.log &

then, rhoconnect stop automatically.

Are there an option to run rhoconnect without terminal?

Thanks for your answer.


Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Darryn Campbell
Look at dos here: http:/

Look at dos here: http://edgedocs.rhomobile.com/rhoconnect/deploying#deploying-packaged-rh...

Production environment includes scripts to run redis, nginx, and your rhoconnect app.

You can start all services automatically and monitor then, but such things are platform specific.

We just provide generic stack with all required components.

-Alexander

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Darryn Campbell
Thanks Alexander, but we have

Thanks Alexander, but we have an error on starting "thin" service/server of our application.

/opt/rhoconnect/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/runtime.rb:31:in `block in setup': You have already activated eventmachine 1.0.0.beta.4, but your Gemfile requires eventmachine 0.12.10. Using bundle exec may solve this. (Gem::LoadError)

...

...

With "gem install eventmachine" don't resolve problem. Have you any idea to run "thin" without this error.

We have 2 config files for "thin" in "/etc/thin/"  (rhoapp.yml and our_app.yml). "rhoapp.yml" without changes, and a new configuration on "our_app.yml" file. We've change parameters of the new file "log: /opt/nginx/logs/gotconnect_thin.log / pid: /var/run/gotconnect_thin.pid / socket: /tmp/gotconnect_thin.sock".

Thanks again.

   Bernat

   Oesia

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Alexander Babichev
It appears you Gemfile.lock

It appears you Gemfile.lock locked to old version of eventmachine. Delete it and run again in your rhoconnect project directory

$ /opt/rhoconnect/bin/bundle install

and then check that new bundle uses latest version:

$ /opt/rhoconnect/bin/bundle show

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Oesia Project
Thanks Alexander.We solve it

Thanks Alexander.

We solve it uninstalling gem "eventmachine 1.0.0.beta.4", and editing Gemfile. At moment,

the solution is change restriction of this gem, changing

  "gem 'eventmachine', '~> 1.0.0.beta', :platforms => [:mswin, :mingw]"

      to

  "gem 'eventmachine', '= 0.12.10', :platforms => [:mswin, :mingw]"

 

We had installed 2 gems (1.0.0.beta.4 and 0.12.10). Removing "1.0.0.beta.4" our problem was solved.

Then, we have removed "Gemfile.lock" for generate it again with your instructions:

    $ /opt/rhoconnect/bin/bundle install

     

Now, thin server for our application is running like service with this command on rc.d profile of server.

    $ /etc/init.d/thin [stop|start|restart]

 

Thanks a lot.

   Bernat  

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


erika contiero
Hi Bernat and all,Do you put

Hi Bernat and all,

Do you put in rc.d profile only the command /etc/init.d/thin start ?

We need to start rhoconnect automatically at the start of the server, we tried to put the 3 commands in rc.local

/etc/init.d/redis start
/etc/init.d/thin start
/etc/init.d/nginx start

but without the commands cd /opt/nginx/html/rhoapp and rhoconnect start the rhoconnect service is not available (no RhoConnect console, no sync service).

Is your rhoconnect server up and running with an automatic start?


I thank you for your attention.


Erika

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Alexander Babichev
Actually you can stop

Actually you can stop rhoconnect app from another terminal:

$ rhoconnect stop

Another option for Linux servers is to use scripts installed by rhoconnect package (deb for Ubuntu, rpm for Cent OS).

See file /opt/rhoconnect/README for details.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


David Strom
Would this help?http://docs
Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Lars Burgess
That documentation is more

That documentation is more around running bulk sync workers, not really running rhoconnect itself in the background.

Are you using the rhoconnect debian package?  If so then you already have a thin and nginx init script installed for you that runs rhoconnect in the background. 

http://docs.rhomobile.com/rhoconnect/deploying#deploying-packaged-rhoconnect-software-on-linux-servers

This setup sends log data to the thin process logs.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Alexander Babichev
Are you able to run

Are you able to run rhoconnect server manually by starting scripts for redis. thin, and nginx?

Script for thin actually does for you 1) cd to rhoapp directory, and 2) launching rhoconnect.

All settings for thin are in /etc/thin/rhoapp.yml file. 

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments