Spacing, quotes. Main thing is to delete Object cache on HUP
This commit is contained in:
parent
3cb5ef6a94
commit
fd72689182
|
@ -77,11 +77,11 @@ my $version = 0;
|
||||||
my $zm_terminate = 0;
|
my $zm_terminate = 0;
|
||||||
|
|
||||||
GetOptions(
|
GetOptions(
|
||||||
'daemon' =>\$daemon,
|
daemon =>\$daemon,
|
||||||
'filter=s' =>\$filter_name,
|
'filter=s' =>\$filter_name,
|
||||||
'filter_id=s' =>\$filter_id,
|
'filter_id=s' =>\$filter_id,
|
||||||
'version' =>\$version
|
version =>\$version
|
||||||
) or pod2usage(-exitstatus => -1);
|
) or pod2usage(-exitstatus => -1);
|
||||||
|
|
||||||
if ( $version ) {
|
if ( $version ) {
|
||||||
print ZoneMinder::Base::ZM_VERSION . "\n";
|
print ZoneMinder::Base::ZM_VERSION . "\n";
|
||||||
|
@ -98,15 +98,16 @@ use constant EVENT_PATH => ($Config{ZM_DIR_EVENTS}=~m|/|)
|
||||||
|
|
||||||
logInit($filter_id?(id=>'zmfilter_'.$filter_id):());
|
logInit($filter_id?(id=>'zmfilter_'.$filter_id):());
|
||||||
sub HupHandler {
|
sub HupHandler {
|
||||||
Info("Received HUP, reloading");
|
Info('Received HUP, reloading');
|
||||||
|
ZoneMinder::Object::init_cache();
|
||||||
&ZoneMinder::Logger::logHupHandler();
|
&ZoneMinder::Logger::logHupHandler();
|
||||||
}
|
}
|
||||||
sub TermHandler {
|
sub TermHandler {
|
||||||
Info("Received TERM, exiting");
|
Info('Received TERM, exiting');
|
||||||
$zm_terminate = 1;
|
$zm_terminate = 1;
|
||||||
}
|
}
|
||||||
sub Term {
|
sub Term {
|
||||||
exit( 0 );
|
exit(0);
|
||||||
}
|
}
|
||||||
$SIG{HUP} = \&HupHandler;
|
$SIG{HUP} = \&HupHandler;
|
||||||
$SIG{TERM} = \&TermHandler;
|
$SIG{TERM} = \&TermHandler;
|
||||||
|
@ -175,7 +176,7 @@ if ( $filter_name ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! ( $filter_name or $filter_id ) ) {
|
if ( ! ( $filter_name or $filter_id ) ) {
|
||||||
Debug("Sleeping due to start delay: " . START_DELAY . ' seconds...');
|
Debug('Sleeping due to start delay: ' . START_DELAY . ' seconds...');
|
||||||
sleep(START_DELAY);
|
sleep(START_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,8 +268,7 @@ sub checkFilter {
|
||||||
Info(
|
Info(
|
||||||
join(' ',
|
join(' ',
|
||||||
'Checking filter', $filter->{Name},
|
'Checking filter', $filter->{Name},
|
||||||
join( ', ',
|
join(', ',
|
||||||
|
|
||||||
($filter->{AutoDelete}?'delete':()),
|
($filter->{AutoDelete}?'delete':()),
|
||||||
($filter->{AutoArchive}?'archive':()),
|
($filter->{AutoArchive}?'archive':()),
|
||||||
($filter->{AutoVideo}?'video':()),
|
($filter->{AutoVideo}?'video':()),
|
||||||
|
@ -385,7 +385,7 @@ sub generateVideo {
|
||||||
$format = $ffmpeg_formats[0];
|
$format = $ffmpeg_formats[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
my $command = join( '',
|
my $command = join('',
|
||||||
$Config{ZM_PATH_BIN},
|
$Config{ZM_PATH_BIN},
|
||||||
'/zmvideo.pl -e ',
|
'/zmvideo.pl -e ',
|
||||||
$event->{Id},
|
$event->{Id},
|
||||||
|
@ -397,7 +397,7 @@ sub generateVideo {
|
||||||
$format,
|
$format,
|
||||||
);
|
);
|
||||||
my $output = qx($command);
|
my $output = qx($command);
|
||||||
chomp( $output );
|
chomp($output);
|
||||||
my $status = $? >> 8;
|
my $status = $? >> 8;
|
||||||
if ( $status || logDebugging() ) {
|
if ( $status || logDebugging() ) {
|
||||||
Debug("Output: $output\n");
|
Debug("Output: $output\n");
|
||||||
|
|
Loading…
Reference in New Issue