File zmpkg_db_init.patch of Package ZoneMinder
From e5b9c6dd3ced8da0fd3a1575131a621ad3f13c98 Mon Sep 17 00:00:00 2001
From: Dirk Hartmann <monex@liquid-co.de>
Date: Fri, 3 Jan 2014 21:33:40 +0100
Subject: [PATCH 2/7] zmpkg_db_init.patch
---
scripts/zmpkg.pl.in | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/scripts/zmpkg.pl.in b/scripts/zmpkg.pl.in
index 4b2032a8d..94e9c9bfc 100644
--- a/scripts/zmpkg.pl.in
+++ b/scripts/zmpkg.pl.in
@@ -54,6 +54,13 @@ if ( $command eq 'version' ) {
my $state;
my $dbh = zmDbConnect();
+
+my $zm_db_init_status = system( "zm_database_init --non-interactive" );
+if ( $zm_db_init_status ne 0 ) {
+ Fatal( "Could not execute zm_database_init" );
+ exit( -1 );
+}
+
Debug("Command: $command");
if ( $command and ( $command !~ /^(?:start|stop|restart|status|logrot|version)$/ ) ) {
# Check to see if it's a valid run state
--
2.26.0