service stopped after reboot

I developed C# application using Mono Develop and deployed as mono-service on Linux Ubuntu 14.04. There are few problems which I don't understand:

  • I noticed that mono-service application stop running after system is rebooted and lock file not exists.
  • Also I noticed when I disconnect power of computer mono-service application stop running. Beside that, sometimes lock file exists even if mono-service application is stopped. Than when I read PID from file and try execute command "KILL pid" it said: "pid is not such a service"!
  • If is mono-service application stopped I noticed that I cannot remove any file and I received exception: "Permission denied". Probably because process still exists as Zombie.
  • Now, my question is: How I can properly maintain application which runs on mono-service? I mean how I can properly Start, Stop (without zombies) and ensure that service will runs always. Do I need to add some cron job to maintain this too?

    I followed linux.die.net for for Start, Stop and Reset. This is how I start service:

    mono-service -l:/root/app-lock /home/emc/appfolder/app.exe
    

    Also I read mattdeboard articles but I am still confused what is right way to keep service properly running.

    链接地址: http://www.djcxy.com/p/90036.html

    上一篇: 作为不同用户运行Linux服务的最佳实践

    下一篇: 服务在重启后停止