X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FDaemon.pm;h=ca181345a493fc38784ad0cf29e2fd28459f237c;hb=7b125e587a4d1ee0aca692e23ea7897f671855ae;hp=7e0d45c2064d38113f3cfa0ce262f337d4ac42a0;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0;p=freeside.git diff --git a/FS/FS/Daemon.pm b/FS/FS/Daemon.pm index 7e0d45c20..ca181345a 100644 --- 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); -@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'; @@ -74,6 +77,11 @@ sub sigterm { $sigterm; } sub logfile { $logfile = shift; } #_logmsg('test'); } +sub myexit { + unlink $pid_file if -e $pid_file; + exit; +} + sub _die { my $msg = shift; unlink $pid_file if -e $pid_file;