Matvey Aksenov
Matvey Aksenov

Reputation: 3900

Daemon process cannot survive suspend

I am writing daemon application for Debian Sid. It works perfectly most of the times, but dies silently after i put my laptop to suspend (or hibernate). So i have a couple of questions:

  1. What should I Google for solutions?
  2. Maybe, you have any ideas what is going on?

Upvotes: 3

Views: 262

Answers (2)

Matvey Aksenov
Matvey Aksenov

Reputation: 3900

Daemon's loop was on blocking read call, and suspend (hibernate) interrupts it. So, should check errnos more accurately.
Fixed by adding:

if ( errno == EINTR ) continue;

Upvotes: 0

jpalecek
jpalecek

Reputation: 47770

Try strace-ing the daemon to see what is the reason it dies silently. Generally, suspend/hibernate alone should have no effect on user processes.

Upvotes: 1

Related Questions