summaryrefslogtreecommitdiff
path: root/pcr/zoneminder
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/zoneminder')
-rw-r--r--pcr/zoneminder/PKGBUILD163
-rw-r--r--pcr/zoneminder/httpd-zm.conf8
-rw-r--r--pcr/zoneminder/httpd-zoneminder.conf20
-rw-r--r--pcr/zoneminder/zoneminder63
-rw-r--r--pcr/zoneminder/zoneminder.install124
-rw-r--r--pcr/zoneminder/zoneminder.service1
6 files changed, 301 insertions, 78 deletions
diff --git a/pcr/zoneminder/PKGBUILD b/pcr/zoneminder/PKGBUILD
index bb850eec2..e5e54537b 100644
--- a/pcr/zoneminder/PKGBUILD
+++ b/pcr/zoneminder/PKGBUILD
@@ -8,58 +8,118 @@
pkgname=zoneminder
pkgver=1.25.0
-pkgrel=17
+pkgrel=20
pkgdesc='Capture, analyse, record and monitor video security cameras'
-arch=(i686 x86_64 mips64el)
-backup=(etc/zm.conf etc/httpd/conf/extra/httpd-zm.conf)
-url=http://www.$pkgname.com
-license=(GPL)
+arch=(
+ i686
+ x86_64
+ mips64el
+)
+backup=(
+ etc/zm.conf
+)
+url="http://www.$pkgname.com"
+license=(
+ GPL
+)
depends=(
- apache cambozola ffmpeg-static gnutls mysql perl-archive-zip perl-date-manip
- perl-dbd-mysql perl-dbi perl-expect perl-libwww perl-mime-lite
- perl-mime-tools perl-php-serialization perl-net-sftp-foreign perl-sys-mmap
- perl-time-modules perl-x10 php php-apache php-gd php-mcrypt
+ apache
+ cambozola
+ ffmpeg-static
+ gnutls
+ mysql
+ perl-archive-zip
+ perl-date-manip
+ perl-dbd-mysql
+ perl-dbi
+ perl-expect
+ perl-libwww
+ perl-mime-lite
+ perl-mime-tools
+ perl-php-serialization
+ perl-net-sftp-foreign
+ perl-sys-mmap
+ perl-time-modules
+ perl-x10
+ php
+ php-apache
+ php-gd
+ php-mcrypt
+)
+makedepends=(
+ netpbm
+)
+optdepends=(
+ netpbm
)
-makedepends=(netpbm)
install=$pkgname.install
source=(
http://www.$pkgname.com/downloads/ZoneMinder-$pkgver.tar.gz
- httpd-zm.conf
- zm.rc.d
+ httpd-$pkgname.conf
+ $pkgname
$pkgname.service
patch-ffmpeg-0.11.patch
)
-md5sums=(
- eaefa14befd482154970541252aa1a39
- 25ad042b501aaad98cbe4e05ca0a96c2
- 034b61cda8849fc3001849e76ef26041
- 7487cc72ead82aea0bc78f2e4106ae1a
- 81c8be870260142e2633eedf73c72040
+sha512sums=(
+ 3e18993b0539729491052c97d8c94227ccc089eb40277c2f07682f30049033303c7cfe9734fdac6d33ae67df29c76eb72bf7fbb5dae8227e8831fa603b61c375
+ 4ce0d8eba9d006d258f5b8a83920fc17f1f602b96518d37b7a47cd9b6eb84ef2587641a6ba839a469c3f0e33b46475866187279ae3f8be0d4054b074ee5d6b08
+ ab4e1d5ddaf4d9cd53d6ca59d7965902afd6a2dc830fbbafa270736c52c2b3563075fee860bb0276466f96e9dbfb71b259ac45a4ae2e4ead8eaec154a0159eb0
+ cfb0eb87a989236c72741a496ddc6a73aa2696e5beaaca4836d3c231ddb24c7ef5e9f65e7afa49674f2115cbfa4a07c75486e1947ce294c816ddbb875f3b99cf
+ 382799ad6add1632d934544230520f942dae37913b58cfa19e0cb2b11e7002267b1fdb9aa535f2217bcccf0c85c4d754f316dc3980a3ca267e5b3f5500536024
)
+
build() {
cd $srcdir/ZoneMinder-$pkgver
- export CPPFLAGS=-D__STDC_CONSTANT_MACROS \
- ZM_SSL_LIB=gnutls
+ # ZM_RUNDIR need change to run dir
+ export CPPFLAGS=-D__STDC_CONSTANT_MACROS\
+ ZM_LOGDIR=/var/log/$pkgname\
+ ZM_RUNDIR=/tmp/$pkgname\
+ ZM_SSL_LIB=gnutls\
+ ZM_TMPDIR=/tmp/$pkgname
# Patch for GCC 4.7.x
- sed -i -e 's/^#include <errno.h>/#include <errno.h>\n#include <unistd.h>/' src/zm_logger.cpp
- sed -i -e 's/^#include <pthread.h>/#include <pthread.h>\n#include <unistd.h>/' src/zm_thread.h
+ sed -i -e 's/^#include <errno.h>/#include <errno.h>\n#include <unistd.h>/'\
+ src/zm_logger.cpp || read
+ sed -i -e 's/^#include <pthread.h>/#include <pthread.h>\n#include <unistd.h>/'\
+ src/zm_thread.h || read
+
+ # Patch for automake 1.12
+ sed -i -e '/am__api_version=/ s/1.11/1.12/'\
+ configure || read
# Patch for disable ZM_CHECK_FOR_UPDATES
- sed -i -e '/ZM_CHECK_FOR_UPDATES/,+1 s/yes/no/' scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in
+ sed -i -e '/ZM_CHECK_FOR_UPDATES/,+1 s/yes/no/'\
+ scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read
# Patch for support html5 video and flv
sed -i -e '/ZM_MPEG_LIVE_FORMAT/,+1 s/swf/webm/;/ZM_MPEG_REPLAY_FORMAT/,+1 s/swf/webm/;
/ZM_FFMPEG_FORMATS/,+1 s/mpg mpeg wmv asf avi\* mov swf 3gp\*\*/mpg mpeg wmv asf avi\* mov flv swf 3gp\*\* webm ogg h254/'\
- scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in
+ scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read
+
+ # Patch for change path run dir
+ sed -i -e '/ZM_PATH_SOCKS/,+1 s/TMP/RUN/'\
+ scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read
+
+ # Patch for change ZM name to ZoneMinder
+ sed -i -e '/ZM_WEB_TITLE_PREFIX/,+1 s/"ZM"/"ZoneMinder"/'\
+ scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in || read
+
+ # Patch for v4l1 compat support
+ sed -i -e "s/$ENV{SHELL} = \'\/bin\/sh\' if exists $ENV{SHELL};/$ENV{SHELL} = \'\/bin\/sh\' if exists $ENV{SHELL};\n$ENV{LD_PRELOAD} = \'\/usr\/lib\/libv4l\/v4l1compat.so\' ;/"\
+ scripts/zmdc.pl.in || read
+
+ # Patch for add more socket tries
+ sed -i -e '/$max_socket_tries/ s/3/15/'\
+ web/ajax/stream.php || read
# Patch for wrong "suppported"
- sed -i -e 's/suppported/supported/' src/zm_local_camera.cpp
+ sed -i -e 's/suppported/supported/'\
+ src/zm_local_camera.cpp || read
# Patch for type cast in linux-libre kernel 3.5
sed -i -e 's/enum v4l2_buf_type type = v4l2_data.fmt.type;/enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type;/'\
- src/zm_local_camera.cpp
+ src/zm_local_camera.cpp || read
# Patch for drop custom perl install paths
sed -i -e '/# Slight hack for non-standard perl install paths/,+10 d;
@@ -93,22 +153,22 @@ build() {
/ ( cd $(DESTDIR)$(sysconfdir); chown $(webuser):$(webgroup) $(sysconf_DATA); chmod 600 $(sysconf_DATA) )/d;
/ ( if ! test -e $(ZM_RUNDIR); then mkdir -p $(ZM_RUNDIR); fi; if test "$(ZM_RUNDIR)" != "\/var\/run"; then chown $(webuser):$(webgroup) $(ZM_RUNDIR); chmod u+w $(ZM_RUNDIR); fi )/d;
/ ( if ! test -e $(ZM_TMPDIR); then mkdir -m 700 -p $(ZM_TMPDIR); fi; if test "$(ZM_TMPDIR)" != "\/tmp"; then chown $(webuser):$(webgroup) $(ZM_TMPDIR); chmod u+w $(ZM_TMPDIR); fi )/d;
- / ( if ! test -e $(ZM_LOGDIR); then mkdir -p $(ZM_LOGDIR); fi; if test "$(ZM_LOGDIR)" != "\/var\/log"; then chown $(webuser):$(webgroup) $(ZM_LOGDIR); chmod u+w $(ZM_LOGDIR); fi )/,+1 d' \
+ / ( if ! test -e $(ZM_LOGDIR); then mkdir -p $(ZM_LOGDIR); fi; if test "$(ZM_LOGDIR)" != "\/var\/log"; then chown $(webuser):$(webgroup) $(ZM_LOGDIR); chmod u+w $(ZM_LOGDIR); fi )/,+1 d'\
Makefile.{am,in}
- ./configure --prefix=/usr \
- --build \
- --enable-crashtrace=no \
- --enable-debug=no \
- --enable-mmap=yes \
- --sysconfdir=/etc \
- --with-cgidir=/usr/lib/$pkgname/cgi-bin \
- --with-ffmpeg=/usr \
- --with-libarch=lib \
- --with-mysql=/usr \
- --with-webdir=/usr/share/$pkgname/www \
- --with-webgroup=http \
- --with-webhost=localhost \
+ ./configure --prefix=/usr\
+ --enable-crashtrace=no\
+ --enable-debug=no\
+ --enable-mmap=yes\
+ --sysconfdir=/etc\
+ --with-cgidir=/srv/http/cgi-bin\
+ --with-extralibs='-L/usr/lib -L/usr/lib/mysql'\
+ --with-ffmpeg=/usr\
+ --with-libarch=lib\
+ --with-mysql=/usr\
+ --with-webdir=/srv/http/$pkgname\
+ --with-webgroup=http\
+ --with-webhost=localhost\
--with-webuser=http
make V=0
@@ -119,21 +179,22 @@ package() {
make DESTDIR=$pkgdir install
- mkdir -p $pkgdir/{etc/{httpd/conf/extra,rc.d},usr/{lib/{systemd/system,$pkgname/cgi-bin},share/{license/$pkgname,$pkgname/{db,www}}},var/{cache/$pkgname,log/zm}}
+ mkdir -p $pkgdir/{etc/{httpd/conf/extra,rc.d},srv/http/{cgi-bin,$pkgname},usr/{lib/systemd/system,share/{license/$pkgname,$pkgname/db}},var/{cache/$pkgname,log/$pkgname}}
- chown -R http.http $pkgdir/{etc/zm.conf,var/{cache/$pkgname,log/zm}}
+ chown -R http.http $pkgdir/{etc/zm.conf,var/{cache/$pkgname,log/$pkgname}}
+ chmod 0700 $pkgdir/etc/zm.conf
for i in events images temp; do
- mv $pkgdir/usr/share/$pkgname/www/$i $pkgdir/var/cache/$pkgname/$i
- ln -s /var/cache/$pkgname/$i $pkgdir/usr/share/$pkgname/www/$i
+ mv $pkgdir/srv/http/$pkgname/$i $pkgdir/var/cache/$pkgname/$i
+ ln -s /var/cache/$pkgname/$i $pkgdir/srv/http/$pkgname/$i
done
- ln -s /usr/lib/$pkgname/cgi-bin $pkgdir/usr/share/$pkgname/www
- ln -s /usr/share/cambozola/cambozola.jar $pkgdir/usr/share/$pkgname/www
+ ln -s /srv/http/cgi-bin $pkgdir/srv/http/$pkgname
+ ln -s /usr/share/cambozola/cambozola.jar $pkgdir/srv/http/$pkgname
- install -D -m 644 $srcdir/httpd-zm.conf $pkgdir/etc/httpd/conf/extra
- install -D -m 644 $srcdir/zm.rc.d $pkgdir/etc/rc.d/zm
- install -D -m 644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system
- install -D -m 644 COPYING $pkgdir/usr/share/license/$pkgname
- install -D -m 644 db/zm*.sql $pkgdir/usr/share/$pkgname/db
+ install -D -m 644 $srcdir/httpd-$pkgname.conf $pkgdir/etc/httpd/conf/extra
+ install -D -m 644 $srcdir/$pkgname $pkgdir/etc/rc.d
+ install -D -m 644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system
+ install -D -m 644 COPYING $pkgdir/usr/share/license/$pkgname
+ install -D -m 644 db/zm*.sql $pkgdir/usr/share/$pkgname/db
}
diff --git a/pcr/zoneminder/httpd-zm.conf b/pcr/zoneminder/httpd-zm.conf
index 8c6356aec..aeb089bc1 100644
--- a/pcr/zoneminder/httpd-zm.conf
+++ b/pcr/zoneminder/httpd-zm.conf
@@ -1,8 +1,8 @@
# /etc/httpd/conf/extra/httpd-zm.conf
# Config for zoneminder web app
-Alias /zm "/usr/share/zoneminder/www"
-<Directory "/usr/share/zoneminder/www">
+Alias /zm "/srv/http/zoneminder"
+<Directory "/srv/http/zoneminder">
Options -Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
@@ -11,8 +11,8 @@ Alias /zm "/usr/share/zoneminder/www"
php_value short_open_tag On
</Directory>
-ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
-<Directory "/usr/lib/zoneminder/cgi-bin">
+ScriptAlias /cgi-bin "/srv/http/cgi-bin"
+<Directory "/srv/http/cgi-bin">
AllowOverride None
Options ExecCGI FollowSymLinks
Order allow,deny
diff --git a/pcr/zoneminder/httpd-zoneminder.conf b/pcr/zoneminder/httpd-zoneminder.conf
new file mode 100644
index 000000000..aeb089bc1
--- /dev/null
+++ b/pcr/zoneminder/httpd-zoneminder.conf
@@ -0,0 +1,20 @@
+# /etc/httpd/conf/extra/httpd-zm.conf
+# Config for zoneminder web app
+
+Alias /zm "/srv/http/zoneminder"
+<Directory "/srv/http/zoneminder">
+ Options -Indexes MultiViews FollowSymLinks
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+ # The code unfortunately uses short tags in many places
+ php_value short_open_tag On
+</Directory>
+
+ScriptAlias /cgi-bin "/srv/http/cgi-bin"
+<Directory "/srv/http/cgi-bin">
+ AllowOverride None
+ Options ExecCGI FollowSymLinks
+ Order allow,deny
+ Allow from all
+</Directory>
diff --git a/pcr/zoneminder/zoneminder b/pcr/zoneminder/zoneminder
new file mode 100644
index 000000000..c4cbf4d3f
--- /dev/null
+++ b/pcr/zoneminder/zoneminder
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+daemon_name=zm
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting Zoneminder"
+ /usr/bin/zmfix -a
+ if /usr/bin/zmpkg.pl start >/dev/null ; then
+ add_daemon $daemon_name
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy "Stopping Zoneminder"
+ if /usr/bin/zmpkg.pl stop >/dev/null ; then
+ rm_daemon $daemon_name
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ reload)
+ stat_busy "Reloading Zoneminder"
+ if /usr/bin/zmpkg.pl graceful >/dev/null ; then
+ add_daemon $daemon_name
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ restart)
+ stat_busy "Restarting Zoneminder"
+ if /usr/bin/zmpkg.pl restart >/dev/null ; then
+ add_daemon $daemon_name
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ status)
+ stat_busy "Checking Zoneminder status";
+ ck_status $daemon_name
+ ;;
+
+ *)
+ echo "usage: $0 {start|stop|reload|restart|status}"
+esac
+
+exit 0
diff --git a/pcr/zoneminder/zoneminder.install b/pcr/zoneminder/zoneminder.install
index 922aaad9b..899e2a5d1 100644
--- a/pcr/zoneminder/zoneminder.install
+++ b/pcr/zoneminder/zoneminder.install
@@ -1,14 +1,14 @@
pre_install() {
set -e
abort=false
- if [ -L /usr/share/zoneminder/www/events ]; then
- l=$(readlink /usr/share/zoneminder/www/events)
+ if [ -L /srv/http/zoneminder/events ]; then
+ l=$(readlink /srv/http/zoneminder/events)
if [ $l != /var/cache/zoneminder/events ]; then
abort=true
fi
fi
- if [ -L /usr/share/zoneminder/www/images ]; then
- l=$(readlink /usr/share/zoneminder/www/images )
+ if [ -L /srv/http/zoneminder/images ]; then
+ l=$(readlink /srv/http/zoneminder/images)
if [ $l != /var/cache/zoneminder/images ]; then
abort=true
fi
@@ -16,7 +16,7 @@ pre_install() {
if [ $abort = true ]; then
cat >&2 << EOF
Aborting installation of zoneminder due to non-default symlinks in
-/usr/share/zoneminder/www for the images and/or events directory, which could
+/srv/http/zoneminder for the images and/or events directory, which could
result in loss of data. Please move your data in each of these directories to
/var/cache/zoneminder before installing zoneminder from the package.
EOF
@@ -26,18 +26,73 @@ EOF
}
post_install() {
- mkdir /usr/share/zoneminder/www/backup
- mkdir /usr/share/zoneminder/www/socks
+ if [[ -d /var/log/zoneminder ]]; then
+ chmod 0755 /var/log/zoneminder
+ chown http.http /var/log/zoneminder
+ else
+ mkdir -m 0755 /var/log/zoneminder
+ chown http.http /var/log/zoneminder
+ fi
+ if [[ -d /tmp/zoneminder ]]; then
+ chmod 0700 /tmp/zoneminder
+ chown http.http /tmp/zoneminder
+ else
+ mkdir -m 0700 /tmp/zoneminder
+ chown http.http /tmp/zoneminder
+ fi
+ sed -i -e '
+ /^;extension=mysql.so/ s/^;//;
+ /^#extension=mysql.so/ s/^#//;
+ /^;extension=mysqli.so/ s/^;//;
+ /^#extension=mysqli.so/ s/^#//;
+ /^;extension=gd.so/ s/^;//;
+ /^#extension=gd.so/ s/^#//;
+ /^;extension=gettext.so/ s/^;//;
+ /^#extension=gettext.so/ s/^#//;
+ /^;extension=mcrypt.so/ s/^;//;
+ /^#extension=mcrypt.so/ s/^#//;
+ /^;extension=session.so/ s/^;//;
+ /^#extension=session.so/ s/^#//;
+ /^;extension=sockets.so/ s/^;//;
+ /^#extension=sockets.so/ s/^#//;
+ /^;extension=openssl.so/ s/^;//;
+ /^#extension=openssl.so/ s/^#//;
+ /^;extension=ftp.so/ s/^;//;
+ /^#extension=ftp.so/ s/^#//;
+ /^;extension=zip.so/ s/^;//;
+ /^#extension=zip.so/ s/^#//;
+ /^;open_basedir/ s/^;//;
+ /^#open_basedir/ s/^#//;
+ /^open_basedir/ s/:\/etc//;
+ /^open_basedir/ s/:\/etc\///;
+ /^open_basedir/ s/$/:\/etc/;
+ /^open_basedir/ s/:\/srv\/http\/zoneminder//;
+ /^open_basedir/ s/:\/srv\/http\/zoneminder\///;
+ /^open_basedir/ s/$/:\/srv\/http\/zoneminder/;
+ ' /etc/php/php.ini || read
+ sed -i -e '
+ /^LoadModule php5_module modules\/libphp5.so/d;
+ /^LoadModule rewrite_module modules\/mod_rewrite.so/ s/$/\nLoadModule php5_module modules\/libphp5.so/;
+ /^# PHP 5/d;
+ /^# ZoneMinder/d;
+ /^Include \/etc\/httpd\/conf\/extra\/php5_module.conf/d;
+ /^Include \/etc\/httpd\/conf\/extra\/httpd-zoneminder.conf/d;
+ /^Include conf\/extra\/httpd-default.conf/ s/$/\n\n# PHP 5\n\Include \/etc\/httpd\/conf\/extra\/php5_module.conf\n\n# ZoneMinder\nInclude \/etc\/httpd\/conf\/extra\/httpd-zoneminder.conf/;
+ ' /etc/httpd/conf/httpd.conf || read
cat << EOF
-Note:
+Note for mysql:
==> To run Zoneminder, you must install the database running mysql service (as root):
==> "rc.d start mysqld" (in initscripts) or "systemctl start mysqld.service" (in systemd)
-==> and add Zoneminder database typing:
+==> and add Zoneminder database typing (with passsword):
==> "mysqladmin --defaults-file=/etc/mysql/my.cnf -p -f reload"
==> "cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/my.cnf -p"
==> "echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/my.cnf -p mysql"
+==> (or without passsword):
+==> "mysqladmin --defaults-file=/etc/mysql/my.cnf -f reload"
+==> "cat /usr/share/zoneminder/db/zm_create.sql | mysql --defaults-file=/etc/mysql/my.cnf"
+==> "echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/my.cnf mysql"
-Note:
+Note for php:
==> You must uncomment that line in /etc/php/php.ini:
==> "extension=mysql.so"
==> check and make sure these are uncommented:
@@ -47,39 +102,59 @@ Note:
==> "extension=mysqli.so"
==> "extension=session.so"
==> "extension=sockets.so"
+==> "extension=openssl.so"
+==> "extension=ftp.so"
+==> "extension=zip.so"
+==> check and add to open_basedir "/etc" and
+==> "/srv/http/zoneminder" like so
+==> "open_basedir = /home:/tmp:/usr/share/pear:/etc:/srv/http/zoneminder"
+==> and set your timezone in php.ini:
+==> "date.timezone = <your_country>/<your_city>"
-==> You must edit /etc/php/php.ini and add to open_basedir "/etc" and
-==> "/usr/share/zoneminder" like so
-==> "open_basedir = /home:/tmp:/usr/share/pear:/etc:/usr/share/zoneminder/www"
-==> Otherwise ZoneMinder will be unable to read /etc/zm.conf
-==> or display its own web directory
-
-Note:
+Note for apache:
==> You must edit /etc/httpd/conf/httpd.conf and add the line:
==> "LoadModule php5_module modules/libphp5.so"
==> and:
==> "Include /etc/httpd/conf/extra/php5_module.conf"
-==> "Include /etc/httpd/conf/extra/httpd-zm.conf"
+==> "Include /etc/httpd/conf/extra/httpd-zoneminder.conf"
EOF
}
post_upgrade() {
+ post_install
/usr/bin/zmupdate.pl -f >/dev/null
}
post_remove() {
+ if [[ -d /tmp/zoneminder ]]; then
+ rm -vr /tmp/zoneminder
+ fi
+ sed -i -e '
+ /^open_basedir/ s/:\/srv\/http\/zoneminder//;
+ /^open_basedir/ s/:\/srv\/http\/zoneminder\///;
+ ' /etc/php/php.ini || read
+ sed -i -e '
+ /^# ZoneMinder/d;
+ /Include \/etc\/httpd\/conf\/extra\/httpd-zoneminder.conf/d;
+ ' /etc/httpd/conf/httpd.conf || read
cat << EOF
Note:
-==> To clean Zoneminder mysql database, run as root:
+==> To clean Zoneminder mysql database, run as root (with password):
==> "echo 'delete from user where User="zmuser";' | mysql --defaults-file=/etc/mysql/my.cnf -p mysql"
==> "echo 'delete from db where User="zmuser";' | mysql --defaults-file=/etc/mysql/my.cnf -p mysql"
==> "mysqladmin --defaults-file=/etc/mysql/my.cnf -p -f drop zm"
+==> (or without password):
+==> "echo 'delete from user where User="zmuser";' | mysql --defaults-file=/etc/mysql/my.cnf mysql"
+==> "echo 'delete from db where User="zmuser";' | mysql --defaults-file=/etc/mysql/my.cnf mysql"
+==> "mysqladmin --defaults-file=/etc/mysql/my.cnf -f drop zm"
==> Disable http with php if it isn't needed with others servers,
==> comment or remove that lines in /etc/httpd/conf/httpd.conf:
==> "LoadModule php5_module modules/libphp5.so"
==> "Include /etc/httpd/conf/extra/php5_module.conf"
-==> "Include /etc/httpd/conf/extra/httpd-zm.conf"
+
+==> Remove line in /etc/httpd/conf/httpd.conf:
+==> "Include /etc/httpd/conf/extra/httpd-zoneminder.conf"
==> Disable php with mysql if it isn't needed with others servers,
==> comment that lines in /etc/php/php.ini:
@@ -90,8 +165,13 @@ Note:
==> "extension=mysqli.so"
==> "extension=session.so"
==> "extension=sockets.so"
+==> "date.timezone = <my_country>/<my_city>"
+
+==> Edit /etc/php/php.ini and remove "/etc" and "/srv/http/zoneminder"
+==> in the "open_basedir".
+
+==> Remove log files and "zonemider" directory in "/var/log/zoneminder".
-==> edit /etc/php/php.ini and remove "/etc" and "/usr/share/zoneminder/www"
-==> in the open_basedir.
+==> Backup and remove "events", "images" and "temp" dirs in "/var/cache/zoneminder".
EOF
}
diff --git a/pcr/zoneminder/zoneminder.service b/pcr/zoneminder/zoneminder.service
index ba41e8926..05cae6f91 100644
--- a/pcr/zoneminder/zoneminder.service
+++ b/pcr/zoneminder/zoneminder.service
@@ -5,7 +5,6 @@ Required=mysqld.service
[Service]
Type=forking
-PIDFile=/run/zm.pid
ExecStart=/usr/bin/zmpkg.pl start
ExecRestart=/usr/bin/zmpkg.pl restart
ExecStop=/usr/bin/zmpkg.pl stop