1

I don't know how can i detect that the computer has been waken up, or even I would prefer to detect wake-up on lan. I have no idea what is the common way, I found that in /etc/pm/sleep.d I can add a custom script, but i need to get invoked inside my C++ application. Now i know I could also add a custom executable written in C++ and send a socket and listen for it somewhere else but that sounds too complicated.

Martin Kosicky
  • 471
  • 4
  • 12

1 Answers1

1

Your C++ application is a daemon? You may add a shell script to /etc/pm/sleep.d which should send a signal to your C++ application (SIGUSR1, for example). Inside C++ application you need to catch this signal.

see

man kill
man 7 signal
man signal

This is similar to solution with sockets but easier.

lollo
  • 2,289
  • 16
  • 20