sweetblood has asked for the wisdom of the Perl Monks concerning the following question:
Although the service otherwise works it's a real nuisance not being able to trap these stop signals, I'd really prefer to do clean up on the stop rather than do it when the service starts.#!/usr/bin/perl use strict; use warnings; use File::Basename; use sigtrap qw(die untrapped normal-signals error-signals); INIT { my $me = basename($0); sendmail('me@mydomain.com', "Service: $me Started", 'Service Start +ed') } END { my $me = basename($0); sendmail('me@mydomain.com', "Service: $me Ended", 'Service Ended') }
TIA
Sweetblood
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trapping "Stop" on perl windows service
by ikegami (Patriarch) on May 15, 2009 at 18:44 UTC | |
|
Re: Trapping "Stop" on perl windows service
by Jenda (Abbot) on May 17, 2009 at 09:37 UTC |