summaryrefslogtreecommitdiff
path: root/pcr/zoneminder/zoneminder.install
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/zoneminder/zoneminder.install')
-rw-r--r--pcr/zoneminder/zoneminder.install61
1 files changed, 42 insertions, 19 deletions
diff --git a/pcr/zoneminder/zoneminder.install b/pcr/zoneminder/zoneminder.install
index 3ade5355e..5e62cc23e 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/events ]; then
- l=$(readlink /usr/share/zoneminder/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/images ]; then
- l=$(readlink /usr/share/zoneminder/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 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,21 @@ EOF
}
post_install() {
- mkdir /usr/share/zoneminder/backup
- mkdir /usr/share/zoneminder/socks
+ if [ -d /var/log/zoneminder ]; then
+ mkdir -m 0755 /var/log/zoneminder
+ chown http.http /var/log/zoneminder
+ else
+ chmod 0755 /var/log/zoneminder
+ chown http.http /var/log/zoneminder
+ fi
cat << EOF
Note:
==> 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:
-==> 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"
+==> "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"
Note:
==> You must uncomment that line in /etc/php/php.ini:
@@ -50,28 +53,40 @@ Note:
==> "extension=session.so"
==> "extension=sockets.so"
-==> Check /etc/php/php.ini and make sure short_open_tag = On
-==> or ZoneMinder will not work.
-
==> 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
+==> "open_basedir = /home:/tmp:/usr/share/pear:/etc:/srv/http/zoneminder"
==> Otherwise ZoneMinder will be unable to read /etc/zm.conf
==> or display its own web directory
+==> And set your timezone in php.ini: date.timezone = <my_country>/<my_city>
Note:
==> You must edit /etc/httpd/conf/httpd.conf and add the line:
-==> LoadModule php5_module modules/libphp5.so
+==> "LoadModule php5_module modules/libphp5.so"
==> and:
-==> Include /etc/httpd/conf/extra/httpd-zm.conf
+==> "Include /etc/httpd/conf/extra/php5_module.conf"
+==> "Include /etc/httpd/conf/extra/httpd-zm.conf"
EOF
}
post_upgrade() {
/usr/bin/zmupdate.pl -f >/dev/null
+ if [ -d /var/log/zoneminder ]; then
+ mkdir -m 0755 /var/log/zoneminder
+ chown http.http /var/log/zoneminder
+ else
+ chmod 0755 /var/log/zoneminder
+ chown http.http /var/log/zoneminder
+ fi
}
post_remove() {
+ if [ -d /run/zoneminder ]; then
+ rm -vr /run/zoneminder
+ fi
+ if [ -d /tmp/zoneminder ]; then
+ rm -vr /tmp/zoneminder
+ fi
cat << EOF
Note:
==> To clean Zoneminder mysql database, run as root:
@@ -82,6 +97,9 @@ Note:
==> 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"
+
+==> Remove
==> "Include /etc/httpd/conf/extra/httpd-zm.conf"
==> Disable php with mysql if it isn't needed with others servers,
@@ -93,8 +111,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 "/usr/share/zoneminder"
+==> Edit /etc/php/php.ini and remove "/etc" and "/usr/share/zoneminder/www"
==> in the open_basedir.
+
+==> Remove log files and 'zonemider' directory in "/var/log/zoneminder"
+
+==> Backup and remove events images and temp dirs in "/var/cache/zoneminder"
EOF
}