LINUX - Standalone running in background

Hello,

I have a standalone webapp on a Debian 10 server.
I want to launch that app as a background process to make sure it does not stop after all sessions expire.
I call my app with “&” at the end of the command.
I also use “call daemonise” in the app.open event.
The process does not stop but the app does not respond after all sessions are closed.
I have to terminate the process and re-run my command to make the app available again.

My app is built in XOJO 2019R2 64b.

Does anyone know how to solve this ?

Regards

Create a systemd service?

1 Like

Hi,

you need to create a systemd service by creating a file in /etc/systemd/system:

[Unit]
Description=MyOwnWeb-Service
[Service]
Type=simple
ExecStart=/home/pi/mywebservice
user=root
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target

Name it e.g. myweb.service
The parameter ExecStart has to point to your compiled XoJo-WebApp.

Then do a systemctl daemon-reload.
With systemctl start myweb.service you can start, systemctl stop myweb.service you can stop and with systemctl status myweb.service you can see the status.

Hope, this helps.
Marco

1 Like

Thank you for your replies.

I found out there was a “application.autoquit = True” in the code, which remained from when the app was compiled in CGI.

After removing it, everything run smoothly even after all the sessions are closed.