Merge branch 'master' of github.com:ZoneMinder/ZoneMinder into bootstrap-skin

This commit is contained in:
Kyle Johnson 2014-11-20 13:48:12 +00:00
commit f935fa6ca6
4 changed files with 31 additions and 28 deletions

View File

@ -7,7 +7,7 @@ Standards-Version: 3.9.2
Package: zoneminder Package: zoneminder
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2 | httpd, libapache2-mod-php5 | libapache2-mod-fcgid | php5-fpm, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0 Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, apache2, libapache2-mod-php5 | libapache2-mod-fcgid, php5, php5-mysql|php5-mysqlnd, libphp-serialization-perl, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, mariadb-client|mysql-client, libwww-perl, libarchive-tar-perl, libarchive-zip-perl, libdevice-serialport-perl, libpcre3, ffmpeg | libav-tools, rsyslog | system-log-daemon, libmodule-load-perl, libsys-mmap-perl, libjson-any-perl, netpbm, libavdevice53 | libavdevice55, libjpeg8, zip, libnet-sftp-foreign-perl, libio-pty-perl, libexpect-perl, libvlccore5 | libvlccore7 | libvlccore8, libvlc5, libcurl4-gnutls-dev | libcurl4-nss-dev | libcurl4-openssl-dev, libpolkit-gobject-1-0, liburi-encode-perl
Recommends: mysql-server|mariadb-server Recommends: mysql-server|mariadb-server
Description: A video camera security and surveillance solution Description: A video camera security and surveillance solution
ZoneMinder is intended for use in single or multi-camera video security ZoneMinder is intended for use in single or multi-camera video security

View File

@ -33,8 +33,6 @@ require ZoneMinder::Control;
our @ISA = qw(ZoneMinder::Control); our @ISA = qw(ZoneMinder::Control);
our $VERSION = $ZoneMinder::Base::VERSION;
# ========================================================================== # ==========================================================================
# #
# Axis V2 Control Protocol # Axis V2 Control Protocol
@ -79,7 +77,7 @@ sub open
use LWP::UserAgent; use LWP::UserAgent;
$self->{ua} = LWP::UserAgent->new; $self->{ua} = LWP::UserAgent->new;
$self->{ua}->agent( "ZoneMinder Control Agent/".ZM_VERSION ); $self->{ua}->agent( "ZoneMinder Control Agent/".ZoneMinder::Base::ZM_VERSION );
$self->{state} = 'open'; $self->{state} = 'open';
} }

View File

@ -89,6 +89,8 @@ Parameters are :-
-u<dbuser>, --user=<dbuser> - Alternate DB user with privileges to alter DB -u<dbuser>, --user=<dbuser> - Alternate DB user with privileges to alter DB
-p<dbpass>, --pass=<dbpass> - Password of alternate DB user with privileges to alter DB -p<dbpass>, --pass=<dbpass> - Password of alternate DB user with privileges to alter DB
-d<dir>,--dir=<dir> - Directory containing update files if not in default build location -d<dir>,--dir=<dir> - Directory containing update files if not in default build location
-interactive - interact with the user
-nointeractive - do not interact with the user
"); ");
exit( -1 ); exit( -1 );
} }
@ -319,34 +321,37 @@ if ( $freshen )
saveConfigToDB(); saveConfigToDB();
} }
# Now check for MyISAM Tables # Don't do innoDB upgrade if not interactive
my @MyISAM_Tables; if ( $interactive ) {
my $sql = "SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='zm' AND engine = 'MyISAM'"; # Now check for MyISAM Tables
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); my @MyISAM_Tables;
my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); my $sql = "SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='zm' AND engine = 'MyISAM'";
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() );
while( my $dbTable = $sth->fetchrow() ) { while( my $dbTable = $sth->fetchrow() ) {
push @MyISAM_Tables, $dbTable; push @MyISAM_Tables, $dbTable;
} }
$sth->finish(); $sth->finish();
if ( @MyISAM_Tables ) { if ( @MyISAM_Tables ) {
print( "\nPrevious versions of ZoneMinder used the MyISAM database engine.\nHowever, the recommended database engine is InnoDB.\n"); print( "\nPrevious versions of ZoneMinder used the MyISAM database engine.\nHowever, the recommended database engine is InnoDB.\n");
print( "\nHint: InnoDB tables are much less likely to be corrupted during an unclean shutdown.\n\nPress 'y' to convert your tables to InnoDB or 'n' to skip : "); print( "\nHint: InnoDB tables are much less likely to be corrupted during an unclean shutdown.\n\nPress 'y' to convert your tables to InnoDB or 'n' to skip : ");
my $response = <STDIN>; my $response = <STDIN>;
chomp( $response ); chomp( $response );
if ( $response =~ /^[yY]$/ ) { if ( $response =~ /^[yY]$/ ) {
print "\nConverting MyISAM tables to InnoDB. Please wait.\n";
foreach (@MyISAM_Tables) {
$dbh->do(q|SET sql_mode='traditional'|); # Elevate warnings to errors $dbh->do(q|SET sql_mode='traditional'|); # Elevate warnings to errors
my $sql = "ALTER TABLE $_ ENGINE = InnoDB"; print "\nConverting MyISAM tables to InnoDB. Please wait.\n";
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); foreach (@MyISAM_Tables) {
my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() ); my $sql = "ALTER TABLE $_ ENGINE = InnoDB";
$sth->finish(); my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() );
$sth->finish();
}
$dbh->do(q|SET sql_mode=''|); # Set mode back to default $dbh->do(q|SET sql_mode=''|); # Set mode back to default
} }
} }
} } # end if interactive
if ( $version ) if ( $version )
{ {

View File

@ -416,12 +416,12 @@ Monitor::Monitor(
{ {
if ( purpose != QUERY ) if ( purpose != QUERY )
{ {
Error( "Shared data not initialised by capture daemon" ); Error( "Shared data not initialised by capture daemon for monitor %s", name );
exit( -1 ); exit( -1 );
} }
else else
{ {
Warning( "Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results" ); Warning( "Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results for monitor %s", name );
} }
} }