This commit was manufactured by cvs2svn to create tag 'freeside_2_1_0'.
[freeside.git] / FS / FS / Daemon.pm
index 38e6d75..ca18134 100644 (file)
@@ -1,7 +1,7 @@
 package FS::Daemon;
 
 use vars qw( @ISA @EXPORT_OK );
-use vars qw( $pid_dir $me $pid_file $sigint $sigterm $NOSIG $logfile );
+use vars qw( $pid_dir $me $pid_file $sigint $sigterm $logfile );
 use Exporter;
 use Fcntl qw(:flock);
 use POSIX qw(setsid);
@@ -19,8 +19,6 @@ use Date::Format;
 
 $pid_dir = '/var/run';
 
-$NOSIG = 0;
-
 sub daemonize1 {
   $me = shift;
 
@@ -43,10 +41,8 @@ sub daemonize1 {
   #$SIG{CHLD} =  \&REAPER;
   $sigterm = 0;
   $sigint = 0;
-  unless ( $NOSIG ) {
-    $SIG{INT}  = sub { warn "SIGINT received; shutting down\n"; $sigint++;  };
-    $SIG{TERM} = sub { warn "SIGTERM received; shutting down\n"; $sigterm++; };
-  }
+  $SIG{INT}  = sub { warn "SIGINT received; shutting down\n"; $sigint++;  };
+  $SIG{TERM} = sub { warn "SIGTERM received; shutting down\n"; $sigterm++; };
 }
 
 sub drop_root {
@@ -87,7 +83,6 @@ sub myexit {
 }
 
 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);
@@ -103,4 +98,3 @@ sub _logmsg {
   close $log;
 }
 
-1;