[freeside-commits] freeside/FS/FS Daemon.pm,1.3.4.1,1.3.4.2
Ivan,,,
ivan at wavetail.420.am
Wed Jun 16 12:41:26 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv24396/FS/FS
Modified Files:
Tag: FREESIDE_1_9_BRANCH
Daemon.pm
Log Message:
a local XML-RPC server for ncic: daemonize and respond to TERM, RT#7780
Index: Daemon.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Daemon.pm,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.2
diff -u -w -d -r1.3.4.1 -r1.3.4.2
--- Daemon.pm 15 Jun 2010 05:10:34 -0000 1.3.4.1
+++ Daemon.pm 16 Jun 2010 19:41:24 -0000 1.3.4.2
@@ -1,7 +1,7 @@
package FS::Daemon;
use vars qw( @ISA @EXPORT_OK );
-use vars qw( $pid_dir $me $pid_file $sigint $sigterm $logfile );
+use vars qw( $pid_dir $me $pid_file $sigint $sigterm $NOSIG $logfile );
use Exporter;
use Fcntl qw(:flock);
use POSIX qw(setsid);
@@ -19,6 +19,8 @@
$pid_dir = '/var/run';
+$NOSIG = 0;
+
sub daemonize1 {
$me = shift;
@@ -41,9 +43,11 @@
#$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++; };
}
+}
sub drop_root {
my $freeside_gid = scalar(getgrnam('freeside'))
@@ -99,3 +103,4 @@
close $log;
}
+1;
More information about the freeside-commits
mailing list