File zmpkg_db_init.patch of Package ZoneMinder

From 6d9b42a9e52e500070f358ce9e62de4294f51788 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 | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/scripts/zmpkg.pl.in b/scripts/zmpkg.pl.in
index d11e04d5a..f636007c5 100644
--- a/scripts/zmpkg.pl.in
+++ b/scripts/zmpkg.pl.in
@@ -53,8 +53,15 @@ 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 );
+}
+
 Info("Command: $command");
 if ( !$command || $command !~ /^(?:start|stop|restart|status|logrot|version)$/ ) {
   if ( $command ) {
-- 
2.18.0

openSUSE Build Service is sponsored by