-open CONFIG, "$dir/check";
-while (<CONFIG>) {
- my @words = split(/\s+/);
- my $command = shift @words;
- if ($command eq 'check') {
- $checkcommand = join(' ', @words);
- } elsif ($command eq 'on') {
- my $when = shift @words;
- if ($when eq 'failure') {
- push @{$on{failure}}, join(' ', @words);
- } elsif ($when eq 'success') {
- push @{$on{success}}, join(' ', @words);
- } elsif ($when eq 'change') {
- push @{$on{change}}, join(' ', @words);
- } else {
- print "Unknown event in 'on', $dir/check line $.\n";
- }
- } elsif ($command eq 'every') {
- $every = $words[0];
+ umask 027;
+ if (open STDOUT, ">>$logfile") {
+ open STDERR, ">>$logfile";
+ chown $uid, $gid, $logfile;