Changeset 1179 for obs_notify_generic/obs_notify_generic.pm
- Timestamp:
- Jun 3, 2015, 7:20:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
obs_notify_generic/obs_notify_generic.pm
r1178 r1179 76 76 } 77 77 if ($match) { 78 if ( $entry->{'log'} ) { 79 $self->log( $type, $paramRef ); 80 } 78 my $extra = undef; 81 79 if ( $entry->{'action'} ) { 82 80 … … 93 91 eval { 94 92 my $process = 95 IPC::Run::start( [ "sh", "- c", $action, "2>&1" ],93 IPC::Run::start( [ "sh", "--login", "-c", "HOME=/usr/lib/obs $action", "2>&1" ], 96 94 \$in, \$out, \$err ); 97 95 $process->finish(); … … 110 108 111 109 #print "err: ", $err, "\n"; 112 $self->log( 113 $type, 114 $paramRef, 115 { 110 $extra = { 116 111 'action_template' => $entry->{'action'}, 117 112 'action' => $action, 118 113 'returncode' => $rc, 119 114 'output' => $out, 120 } 121 ); 122 115 }; 116 } 117 if ( $entry->{'log'} ) { 118 $self->log( $type, $paramRef, $extra ); 123 119 } 124 120 } else { … … 139 135 my ( $self, $type, $paramRef, $extra ) = @_; 140 136 141 #my $log = "/srv/obs/log/obs-notify-bareos.log";142 137 my $fh; 143 138 my $file_opened = 0; … … 152 147 error_msg( "failed to open log file " . $self->{'logfile'} ); 153 148 return 1; 154 155 #$fh = *STDOUT;156 149 } 157 150 }
Note:
See TracChangeset
for help on using the changeset viewer.