LinHES Forums
http://forums.linhes.org/

Zoneminder and R7.00.03
http://forums.linhes.org/viewtopic.php?f=21&t=22506
Page 1 of 1

Author:  bobmyth [ Wed Mar 07, 2012 10:37 pm ]
Post subject:  Zoneminder and R7.00.03

Anyone installed this? My first attempt was concerning:
Code:
sudo pacman -S zoneminder
resolving dependencies...
looking for inter-conflicts...

Targets (15): jre-6u23-4  cambozola-0.92-1  apr-1.4.2-1  unixodbc-2.3.0-1
              apr-util-1.3.12-2  apache-2.2.17-1  perl-php-serialization-0.27-2
              perl-unicode-map-0.112-2  perl-time-modules-2006.0814-1
              perl-astro-suntime-0.01-2  perl-device-serialport-1.04-2
              perl-x10-0.03-2  perl-net-smtp-ssl-1.01-2  perl-sys-mmap-0.13-1
              zoneminder-1.25.0-2


I already have lighttpd installed, is it going to be removed in favor of apache?

Author:  bobmyth [ Tue Mar 20, 2012 9:23 pm ]
Post subject:  Re: Zoneminder and R7

Install the package:
Code:
pacman -S zoneminder


Code:
sudoedit /etc/sysctl.conf

and append these two lines:
Quote:
kernel.shmall = 134217728
kernel.shmmax = 134217728

Code:
sudo /sbin/sysctl -p /etc/sysctl.conf

to make settings take effect

Fix the zm.conf so you can initialize the database:
Code:
 echo ZM_PATH_UPDATE=/usr/lib/zm/upgrade | sudo tee -a /etc/zm.conf


Initialize database:
Code:
sudo /usr/lib/zm/bin/zminit


Code:
sudoedit /etc/lighttpd/lighttpd.conf

and uncomment mod_alias and then append.

Code:
sudoedit /etc/lighttpd/conf.include

Quote:
alias.url = (
"/cgi-bin" => "/srv/zoneminder/cgi-bin/",
"/zm" => "/srv/zoneminder/www/"
)


restart lighttpd
Code:
sudo killall lighttpd


Fix log permissions
Code:
mkdir /var/log/zm
sudo chown -R http:http /var/log/zm


Fix data directory permissions
Code:
sudo chown -R http:http /var/lib/zm


Configure logrotate to notify zoneminder when log files have been rotated:
Code:
sudoedit /etc/logrotate.d/zm


and add
Quote:
postrotate
/usr/lib/zm/bin/zmpkg.pl logrot
endscript

below in the /var/log/zm/*log section

Have zm run at boot-up
Code:
sudo add_service.sh zm


Use you favorite web browser to configure zoneminder.

Author:  mythedoff [ Fri Mar 23, 2012 10:45 am ]
Post subject:  Re: Zoneminder and R7.00.03

Excellent. I had used generic settings for shmmax and shmall unil I came across this script that will calculate recommended values.


Code:
#!/bin/sh
# Copyright (C) 2010 Chris "Pada" Kistner
# Modified by PacoLM to check only shared memory settings
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# if you find errors, check that coreutils are installed, if not, run the command below
# apt-get -y install coreutils bc
echo "--- Checking memory setting..."
page_size=$(getconf PAGE_SIZE)
mem_bytes=$(awk '/MemTotal:/ { printf "%0.f",$2 * 1024}' /proc/meminfo)
mb=1048576
mem_bytes_mb=$(expr $mem_bytes / $mb)
shmmax=$(echo "$mem_bytes * 0.90" | bc | cut -f 1 -d '.')
shmmax_mb=$(expr $shmmax / $mb)
shmall=$(expr $mem_bytes / $page_size)
shmmax_cur=$(sysctl -n kernel.shmmax)
shmmax_cur_mb=$(expr $shmmax_cur / $mb)
shmall_cur=$(sysctl -n kernel.shmall)
echo "-- Total memory = $mem_bytes B = $mem_bytes_mb MB"
echo "-- Page size = $page_size B"
echo "-- Current kernel.shmmax = $shmmax_cur B = $shmmax_cur_mb MB"
echo "-- Current kernel.shmall = $shmall_cur pages"
if [ "$shmmax" -eq "$shmmax_cur" ] && [ "$shmall" -eq "$shmall_cur" ]; then
    echo "-- Recommended shm values already set"
else
    echo "-- Recommended: kernel.shmmax = $shmmax B = $shmmax_mb MB"
    echo "-- Recommended: kernel.shmall = $shmall pages"
fi
# Done
echo "--- Done."

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/