summaryrefslogtreecommitdiff
path: root/FS/FS/Daemon.pm
diff options
context:
space:
mode:
authorivan <ivan>2008-11-01 22:12:58 +0000
committerivan <ivan>2008-11-01 22:12:58 +0000
commite95a136f9dae69525dd926ce4d3314e407a567c9 (patch)
tree6a39bc6b4bbae7b616ab84526fc2cd230a7cdc84 /FS/FS/Daemon.pm
parenta20987ec5ea35450afbf311829e48e507099dad4 (diff)
have freeside-cdrd disable itself if there's no appropriate package definition, RT#4184
Diffstat (limited to 'FS/FS/Daemon.pm')
-rw-r--r--FS/FS/Daemon.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/FS/FS/Daemon.pm b/FS/FS/Daemon.pm
index 7e0d45c..ca18134 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;