Merge branch 'master' into multi-server

Conflicts:
	distros/ubuntu1504/changelog
This commit is contained in:
Isaac Connor 2015-07-16 10:19:25 -04:00
commit ff9b86fc23
16 changed files with 113 additions and 59 deletions

View File

@ -1,3 +1,11 @@
zoneminder (1.28.1+1-trusty-SNAPSHOT2015071501) trusty; urgency=medium
* fix for issue #586 and #932
* fix for db not being upgraded
* version upgraded to .100
-- Isaac Connor <iconnor@connortechnology.com> Wed, 15 Jul 2015 11:56:28 -0400
zoneminder (1.28.1+1-trusty-SNAPSHOT2015030201) trusty; urgency=medium zoneminder (1.28.1+1-trusty-SNAPSHOT2015030201) trusty; urgency=medium
* maybe fix for RTSP Basic Auth * maybe fix for RTSP Basic Auth

View File

@ -1,3 +1,11 @@
zoneminder (1.28.1+1-vivid-SNAPSHOT2015071501) vivid; urgency=medium
* fix for issue #586 and #932
* fix for db not being upgraded
* version upgraded to .100
-- Isaac Connor <iconnor@connortechnology.com> Wed, 15 Jul 2015 11:56:28 -0400
zoneminder (1.28.1+1-vivid-SNAPSHOT2015070402) vivid; urgency=medium zoneminder (1.28.1+1-vivid-SNAPSHOT2015070402) vivid; urgency=medium
* Correct PRIMARY KEY update code on States table * Correct PRIMARY KEY update code on States table

View File

@ -2,4 +2,4 @@ etc/zm
usr/bin usr/bin
usr/share/polkit-1/actions usr/share/polkit-1/actions
usr/share/polkit-1/rules.d usr/share/polkit-1/rules.d
usr/share/man usr/share/man/man8

View File

@ -1,15 +0,0 @@
# Automatically added by dh_installinit
# In case this system is running systemd, we need to ensure that all
# necessary tmpfiles (if any) are created before starting.
if [ -d /run/systemd/system ] ; then
systemd-tmpfiles --create /usr/lib/tmpfiles.d/zoneminder.conf >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/zoneminder" ]; then
update-rc.d zoneminder defaults >/dev/null
fi
if [ -x "/etc/init.d/zoneminder" ] || [ -e "/etc/init/zoneminder.conf" ]; then
invoke-rc.d zoneminder start || exit $?
fi
# End automatically added section

View File

@ -1,18 +0,0 @@
# Automatically added by dh_installinit
if [ "$1" = "purge" ] ; then
update-rc.d zoneminder remove >/dev/null
fi
# In case this system is running systemd, we make systemd reload the unit files
# to pick up changes.
if [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section

View File

@ -1,5 +0,0 @@
# Automatically added by dh_installinit
if [ -x "/etc/init.d/zoneminder" ] || [ -e "/etc/init/zoneminder.conf" ]; then
invoke-rc.d zoneminder stop || exit $?
fi
# End automatically added section

View File

@ -1,6 +0,0 @@
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section

View File

@ -1,6 +0,0 @@
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section

View File

@ -107,7 +107,14 @@ sub sendCmd
printMsg( $cmd, "Tx" ); printMsg( $cmd, "Tx" );
my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."$cmd" ); my $url;
if ( $self->{Monitor}->{ControlAddress} =~ /^http/ ) {
$url = $self->{Monitor}->{ControlAddress}.$cmd;
} else {
$url = 'http://'.$self->{Monitor}->{ControlAddress}.$cmd;
} # en dif
my $req = HTTP::Request->new( GET=>$url );
my $res = $self->{ua}->request($req); my $res = $self->{ua}->request($req);
if ( $res->is_success ) if ( $res->is_success )

View File

@ -58,6 +58,12 @@ sub open
{ {
my $self = shift; my $self = shift;
my $device = new Device::SerialPort( $self->{path} ); my $device = new Device::SerialPort( $self->{path} );
if ( ! $device )
{
Error( "Unable to open $$self{path}: $!" );
$self->{state} = 'closed';
return;
}
$device->baudrate(9600); $device->baudrate(9600);
$device->databits(8); $device->databits(8);
$device->parity('none'); $device->parity('none');

View File

@ -156,7 +156,7 @@ if ( !$server_up )
while (!connect( CLIENT, $saddr )) while (!connect( CLIENT, $saddr ))
{ {
$attempts++; $attempts++;
Fatal( "Can't connect: $!" ) if ($attempts > MAX_CONNECT_DELAY); Fatal( "Can't connect: $! after $attempts attempts to $sock_file" ) if ($attempts > MAX_CONNECT_DELAY);
sleep(1); sleep(1);
} }
} }

View File

@ -558,9 +558,9 @@ sub kill_until_dead {
sub _stop { sub _stop {
my ($final, $process ) = @_; my ($final, $process ) = @_;
delete( $cmd_hash{$$process{command}} );
my $pid = send_stop( $final, $process ); my $pid = send_stop( $final, $process );
return if ! $pid; return if ! $pid;
delete( $cmd_hash{$$process{command}} );
kill_until_dead( $process ); kill_until_dead( $process );
} }

View File

@ -28,7 +28,82 @@ zmtrigger.pl - ZoneMinder External Trigger Script
=head1 DESCRIPTION =head1 DESCRIPTION
This script is used to trigger and cancel alarms from external connections This script is used to trigger and cancel alarms from external connections
using an arbitrary text based format using an arbitrary text based format.
This script offers generic solution to external triggering of alarms. It
can handle external connections via either internet socket, unix socket or
file/device interfaces. You can either use it 'as is' if you can interface
with the existing format, or override connections and channels to customise
it to your needs.
If enabled by the OPT_TRIGGERS option, Zoneminder service start
zmtrigger.pl which listens for control messages on TCP port 6802.
=head1 TRIGGER MESSAGE FORMAT
B<id>|B<action>|B<score>|B<cause>|B<text>|B<showtext>
=over 4
=item B<id>
is the id number or name of the ZM monitor.
=item B<action>
Valid actions are 'on', 'off', 'cancel' or 'show' where
'on' forces an alarm condition on;
'off' forces an alarm condition off;
'cancel' negates the previous 'on' or 'off'.
The 'show' action merely updates some auxiliary text which can optionally
be displayed in the images captured by the monitor. Ordinarily you would
use 'on' and 'cancel', 'off' would tend to be used to suppress motion
based events. Additionally 'on' and 'off' can take an additional time
offset, e.g. on+20 which automatically 'cancel's the previous action
after that number of seconds.
=item B<score>
is the score given to the alarm, usually to indicate it's
importance. For 'on' triggers it should be non-zero, otherwise it should
be zero.
=item B<cause>
is a 32 char max string indicating the reason for, or source of
the alarm e.g. 'Relay 1 open'. This is saved in the 'Cause' field of the
event. Ignored for 'off' or 'cancel' messages.
=item B<text>
is a 256 char max additional info field, which is saved in the
'Description' field of an event. Ignored for 'off' or 'cancel' messages.
=item B<showtext>
is up to 32 characters of text that can be displayed in the
timestamp that is added to images. The 'show' action is designed to
update this text without affecting alarms but the text is updated, if
present, for any of the actions. This is designed to allow external input
to appear on the images captured, for instance temperature or personnel
identity etc.
=back
Note that multiple messages can be sent at once and should be LF or CRLF
delimited. This script is not necessarily intended to be a solution in
itself, but is intended to be used as 'glue' to help ZoneMinder interface
with other systems. It will almost certainly require some customisation
before you can make any use of it. If all you want to do is generate alarms
from external sources then using the ZoneMinder::SharedMem perl module is
likely to be easier.
=head1 EXAMPLES
3|on+10|1|motion|text|showtext
Triggers "alarm" on camera #3 for 10 seconds with score=1, cause="motion".
=cut =cut
use strict; use strict;

View File

@ -2596,8 +2596,8 @@ void Image::Scale( unsigned int factor )
return; return;
} }
unsigned int new_width = (width*factor)/ZM_SCALE_BASE; unsigned int new_width = (width*factor)/ZM_SCALE_BASE+1;
unsigned int new_height = (height*factor)/ZM_SCALE_BASE; unsigned int new_height = (height*factor)/ZM_SCALE_BASE+1;
size_t scale_buffer_size = new_width * new_height * colours; size_t scale_buffer_size = new_width * new_height * colours;

View File

@ -37,7 +37,7 @@ zmf - The ZoneMinder Frame daemon
This is an optional daemon that can run in concert with the Analysis daemon and This is an optional daemon that can run in concert with the Analysis daemon and
whose function it is to actually write captured frames to disk. This frees up whose function it is to actually write captured frames to disk. This frees up
the Analysis daemon to do more analysis (!) and so keep up with the Capture the Analysis daemon to do more analysis (!) and so keep up with the Capture
daemon better. If it isnt running or dies then the Analysis daemon just writes daemon better. If it isn't running or dies then the Analysis daemon just writes
them itself. them itself.
=head1 OPTIONS =head1 OPTIONS

View File

@ -33,7 +33,7 @@ zmc - The ZoneMinder Utility
=head1 DESCRIPTION =head1 DESCRIPTION
This binary is a handy command line interface to several useful functions. Its This binary is a handy command line interface to several useful functions. It's
not really meant to be used by anyone except the web page (there's only limited not really meant to be used by anyone except the web page (there's only limited
'help' in it so far) but can be if necessary, especially for debugging video 'help' in it so far) but can be if necessary, especially for debugging video
problems. problems.