You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Bryan Boone <bb...@gmail.com> on 2021/08/25 15:35:40 UTC

OFBiz run in background stops working when exit terminal

Hi everyone.  When I run

./gradlew "ofbizBackground —start"

On Centos Linux 7 on AWS EC2, OFBiz starts up and runs in the background just fine.  However when I exit the terminal, the program terminates.

It was working a while ago and I could exit and the program would still run.  Not sure what changed.  Any ideas on how to fix?

Thanks

Re: OFBiz run in background stops working when exit terminal

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Wednesday, August 25, 2021 11:45 AM -0700 Kenneth Porter 
<sh...@sewingwitch.com> wrote:

> Perhaps someone has already written a unit file.

Here's a couple you could use as a starting point. You'll want to add an 
After= for the MySQL dependency.

<https://www.brokenbits.com.br/site/en/blog/2016/10/20/systemd-service-for-apache-ofbiz/>

<https://gist.github.com/bagasme/1de1908c86303c83b7bd51d50a12e041>


Re: OFBiz run in background stops working when exit terminal

Posted by Bryan Boone <bb...@gmail.com>.
Ah okay thanks.  I’ll check it out.



> On Aug 25, 2021, at 10:45 AM, Kenneth Porter <sh...@sewingwitch.com> wrote:
> 
> --On Wednesday, August 25, 2021 11:25 AM -0700 Bryan Boone <bb...@gmail.com> wrote:
> 
>> I will need this for a high availability production environment.  Is it
>> better to run OFBiz on my own installed Tomcat server, rather than the
>> packaged one?  I am already using MySQL Enterprise for the dbase.
> 
>>>> On Centos Linux 7 on AWS EC2, OFBiz starts up and runs in the background
>>>> just fine.  However when I exit the terminal, the program terminates.
> 
> Don't run it from a terminal. That's for testing. For production, run it from systemd using a unit file. Perhaps someone has already written a unit file.
> 


Re: OFBiz run in background stops working when exit terminal

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Wednesday, August 25, 2021 11:25 AM -0700 Bryan Boone 
<bb...@gmail.com> wrote:

> I will need this for a high availability production environment.  Is it
> better to run OFBiz on my own installed Tomcat server, rather than the
> packaged one?  I am already using MySQL Enterprise for the dbase.

>>> On Centos Linux 7 on AWS EC2, OFBiz starts up and runs in the background
>>> just fine.  However when I exit the terminal, the program terminates.

Don't run it from a terminal. That's for testing. For production, run it 
from systemd using a unit file. Perhaps someone has already written a unit 
file.


Re: OFBiz run in background stops working when exit terminal

Posted by Bryan Boone <bb...@gmail.com>.
Thanks for the reply.  That didn’t seem to work either.

I will need this for a high availability production environment.  Is it better to run OFBiz on my own installed Tomcat server, rather than the packaged one?  I am already using MySQL Enterprise for the dbase.

Are there directions somewhere to setup OFBiz on a separate Tomcat server?



> On Aug 25, 2021, at 9:36 AM, Kenneth Porter <sh...@sewingwitch.com> wrote:
> 
> --On Wednesday, August 25, 2021 9:35 AM -0700 Bryan Boone <bb...@gmail.com> wrote:
> 
>> When I run
>> 
>> ./gradlew "ofbizBackground —start"
>> 
>> On Centos Linux 7 on AWS EC2, OFBiz starts up and runs in the background
>> just fine.  However when I exit the terminal, the program terminates.
>> 
>> It was working a while ago and I could exit and the program would still
>> run.  Not sure what changed.  Any ideas on how to fix?
> 
> Perhaps the program was changed to honor the HUP signal, which is sent by the controlling terminal process to all child processes when it exits. Start OFBiz with nohup to keep the shell from sending HUP to it on exit.
> 
> <https://linuxize.com/post/linux-nohup-command/>
> 
> 
> 


Re: OFBiz run in background stops working when exit terminal

Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Wednesday, August 25, 2021 9:35 AM -0700 Bryan Boone 
<bb...@gmail.com> wrote:

> When I run
>
> ./gradlew "ofbizBackground —start"
>
> On Centos Linux 7 on AWS EC2, OFBiz starts up and runs in the background
> just fine.  However when I exit the terminal, the program terminates.
>
> It was working a while ago and I could exit and the program would still
> run.  Not sure what changed.  Any ideas on how to fix?

Perhaps the program was changed to honor the HUP signal, which is sent by 
the controlling terminal process to all child processes when it exits. 
Start OFBiz with nohup to keep the shell from sending HUP to it on exit.

<https://linuxize.com/post/linux-nohup-command/>