Overview
Features
Download
Documentation
Community
Add-Ons & Services

How to shut down application in daemon mode

Please post support and help requests here.

How to shut down application in daemon mode

Postby maximus » 30 May 2013, 16:03

Hello,

I'm using POCO in embedded environment. My app should be started in daemon mode, so now i had to write script that will start/stop/restart this daemon. What I found that I can't properly shut down this daemon, it reacts only on kill -9. If it is running not in daemon mode, then SIGINT also works fine, but I need graceful shutdown in daemon mode. My system is 'Linux RCV-20 2.6.16-cm-x270 #15 Mon Aug 3 17:00:19 EEST 2009 armv5tel GNU/Linux'
Thanks for your support.

Best regards,
Max.
maximus
 
Posts: 3
Joined: 03 Oct 2012, 17:38

Re: How to shut down application in daemon mode

Postby guenter » 31 May 2013, 10:05

If you use Poco::Util::ServerApplication with the --daemon command line argument, then a normal kill should gracefully shut down your application. However, you'll have to make sure that when waitForTerminationRequest() returns, your app is shut down properly and all threads are joined. This can be harder than expected!
guenter
 
Posts: 1153
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: How to shut down application in daemon mode

Postby maximus » 03 Jun 2013, 12:41

Problem was really in one of blocking threads.
Thank a lot, Günter.
maximus
 
Posts: 3
Joined: 03 Oct 2012, 17:38


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron