Running pharo in daemon mode

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Running pharo in daemon mode

sergio_101
Hey, all..

I found my issue.. I need to be running in daemon mode.. i was running with &, but as soon as my connection lets go, the app dies..

I tried using daemon tools, but it looks like the site stays up for one second, and a new PID is generated..

Anyone have any hints on how people are doing this lately?

Thanks!



----
peace,
sergio
photographer, journalist, visionary

Reply | Threaded
Open this post in threaded view
|

Re: Running pharo in daemon mode

Sven Van Caekenberghe-2
There are many options.

Did you read https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/DeploymentWeb/DeployForProduction.html ?

You can also study this https://github.com/svenvc/pharo-server-tools

nohup is an easy to use, quick and dirty solution.

> On 18 Feb 2019, at 22:39, sergio ruiz <[hidden email]> wrote:
>
> Hey, all..
>
> I found my issue.. I need to be running in daemon mode.. i was running with &, but as soon as my connection lets go, the app dies..
>
> I tried using daemon tools, but it looks like the site stays up for one second, and a new PID is generated..
>
> Anyone have any hints on how people are doing this lately?
>
> Thanks!
>
>
>
> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101


Reply | Threaded
Open this post in threaded view
|

Re: Running pharo in daemon mode

Pierce Ng-3
In reply to this post by sergio_101
On Mon, Feb 18, 2019 at 04:39:03PM -0500, sergio ruiz wrote:
> I found my issue.. I need to be running in daemon mode.. i was running with
> &, but as soon as my connection lets go, the app dies..

My daemontools run file:

  #!/bin/sh
  /usr/bin/setuidgid app1 \
    /pkg/vm/pharo -vm-display-null -vm-sound-null app1.image --no-quit

My Dockerfile CMD

  /pkg/vm/pharo -vm-display-null -vm-sound-null app.image --no-quit st runApp.st

You could also try '-headless' instead of '-vm-display-null'.

Pierce

Reply | Threaded
Open this post in threaded view
|

Re: Running pharo in daemon mode

sergio_101
My daemontools run file looks like:

#!/bin/bash

# settings
USER="bandtracker"
VM="/home/bandtracker/pharoImages/pharo"
VM_PARAMS="-mmap 256m -vm-sound-null -vm-display-null"
IMAGE="/home/bandtracker/pharoImages/Pharo.image"

# start the vm
exec \
    setuidgid "$USER" \
    "$VM" $VM_PARAMS "$IMAGE" --no-quit

but for some reason, it just sits and grinds and restarts.. never remaining started for more than a second..



On February 18, 2019 at 8:19:24 PM, Pierce Ng ([hidden email]) wrote:

My daemontools run file: 

#!/bin/sh 
/usr/bin/setuidgid app1 \ 
/pkg/vm/pharo -vm-display-null -vm-sound-null app1.image --no-quit 
----
peace,
sergio
photographer, journalist, visionary

Reply | Threaded
Open this post in threaded view
|

Re: Running pharo in daemon mode

Pierce Ng-3
On Tue, Feb 19, 2019 at 05:17:34AM -0800, sergio ruiz wrote:
> My daemontools run file looks like:
> but for some reason, it just sits and grinds and restarts.. never remaining
> started for more than a second..

PharoDebug.log or "ps ax | egrep readproctitle" should contain some
clues.

> VM="/home/bandtracker/pharoImages/pharo"
> IMAGE="/home/bandtracker/pharoImages/Pharo.image"

Looks like you put the VM and image/changes files in the same directory.
Depending on how you set up, Pharo may need write-access to the image's
containing directory, /home/bandtracker/pharoImages in your case.

I suggest to put the VM files somewhere else, and owned by root:root.
This greatly reduces the risk of bug or exploited vulnerability in your
code or Pharo running as your uid overwriting the VM files.

Pierce