develooper Front page | perl.beginners | Postings from October 2009

Daemon::Easy and self-killing

Thread Next
Michael Pobega
October 14, 2009 18:51
Daemon::Easy and self-killing
Message ID:
I'm using the Daemon::Easy module to write a basic Perl daemon, but I'm
wondering if there is a way to stop the daemon from within the script (as
opposed to running "./ stop")? Currently I have a subroutine to do
this, but it doesn't seem to cleanly erase the pid file.

> &killMe {
>         unlink("/tmp/.idle_kick-$");
>         system("gnome-session-save --force-logout"); # the point of the daemon
>         exit;
> }

And yes, $PID is pointing to the proper file (I've used 'print' to manually get
the value, and it's all right).

I've read all of the documentation for the Daemon::Easy module, but it isn't
exactly what I'd call verbose (on the contrary, it's as simplistic as the


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About