Background service on Linux

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


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.



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.