Background service on Linux

  1. 7 months ago

    I am new to Linux and I have developed console application for Linux to be work as Background service to download files from FTP and import them into database
    I wrote code in Run event

    call Daemonize 

    when I run this background service from terminal as ./appname ,it works ok for little time after that it stops working
    Can you please help to resolve this issue

  2. Björn D

    19 Apr 2017 Pre-Release Testers, Xojo Pro Europe
    Edited 7 months ago

    Hello,

    I'm not a Linux Pro too but i use a shell script and cron job for my web apps... The cron job is just running every minute and restarts the service app if needed.

    If you google for "HOW TO Check, Start and Stop Services" you find a solution and example scripts.

    greetings

    Björn

  3. John J

    20 Apr 2017 Pre-Release Testers, Xojo Pro Cleveland, Ohio

    Poonam, if you want to start an app and have it run in the background, you can execute it from a command line and end the line with a "&" character - so it might look something like this

    ./appname &

    That said, the best way to launch a daemon is using the init system (the built in mechanism for starting apps in the OS). This differs from system to system but on unix two of the most common are systemd and upstart. What version of linux are you running?

    This post I wrote covers an intro to upstart, if that applies.

or Sign Up to reply!