projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT#7869: fix error messages when send_email fails in the job queue
[freeside.git]
/
FS
/
FS
/
Daemon.pm
diff --git
a/FS/FS/Daemon.pm
b/FS/FS/Daemon.pm
index
7e0d45c
..
f92a2ee
100644
(file)
--- a/
FS/FS/Daemon.pm
+++ b/
FS/FS/Daemon.pm
@@
-12,7
+12,10
@@
use Date::Format;
#avoid duplicate code. eventually this should use something from CPAN.
@ISA = qw(Exporter);
#avoid duplicate code. eventually this should use something from CPAN.
@ISA = qw(Exporter);
-@EXPORT_OK = qw( daemonize1 drop_root daemonize2 sigint sigterm logfile );
+@EXPORT_OK = qw(
+ daemonize1 drop_root daemonize2 myexit logfile sigint sigterm
+);
+%EXPORT_TAGS = ( 'all' => [ @EXPORT_OK ] );
$pid_dir = '/var/run';
$pid_dir = '/var/run';
@@
-74,7
+77,13
@@
sub sigterm { $sigterm; }
sub logfile { $logfile = shift; } #_logmsg('test'); }
sub logfile { $logfile = shift; } #_logmsg('test'); }
+sub myexit {
+ unlink $pid_file if -e $pid_file;
+ exit;
+}
+
sub _die {
sub _die {
+ die @_ if $^S; # $^S = 1 during an eval(), don't break exception handling
my $msg = shift;
unlink $pid_file if -e $pid_file;
_logmsg($msg);
my $msg = shift;
unlink $pid_file if -e $pid_file;
_logmsg($msg);