README.OpenSuse
1OpenSuse Notes
2===============
3
41. OpenSuse, along with other distros, now use systemd for task control.
5 One of the capabilties of systemd is to use private space for /tmp to reduce
6 the possibility of cross talk between applications. The default settings
7 for zoneminder use /tmp for a number of files. When you start/stop
8 zoneminder from a web page /tmp will be in private space but when the
9 start/stop script zmpkg.pl is run from a shell it will be looking in the
10 real /tmp. This can result in two instances of zoneminder running at
11 the same time.
12
13 In order to remove this problem the OpenSuse rpm defaults the temporary
14 directory to /var/run/zoneminder. For a new install this will not be a
15 problem but if you use the rpm to upgrade you may have to make database
16 changes.
17
18 Note: the location is held both within the database an explicitly within some
19 scripts. It is therefore essential that the database conforms to the values
20 used in the scripts. Please see information in the Upgrades section of this
21 document.
22
232. OpenSuse prefers mariadb to mysql. mariadb is a direct replacement for mysql
24 and all mysql functions work in the same way. These notes assumes that you
25 are running mariadb.
26
273. It is necessary to add repositories to allow the zoneminder rpm to install.
28 These can be added using commands (as root):
29 zypper ar -f http://packman.inode.at/suse/openSUSE_13.1 packman
30 zypper ar -f -n perl-modules http://download.opensuse.org/repositories/devel:/languages:/perl/openSUSE_13.1 perl-modules
31
32 The first time the repositories are accessed a prompt will be issued
33 asking if the key is to be trusted. We suggest that you a(lways) trust
34 this repository
35
364. There may be a prompt about the version of libavcodec.s0.55 and a change
37 of vendor for libavutil52. In order to allow zoneminder to run correctly
38 this solution change vendor should be accepted.
39
40New installs
41============
42
431. Unless you are already using the MySQL server or you are running it
44 remotely you will need to ensure that the server is installed and secured:
45
46 The rpm install should ensure that the database is installed. To ensure
47 that it is running at boot time and secure for zoneminder run the
48 following commands (as root):
49
50 systemctl enable mysql
51
52 systemctl start mysql.service
53
54 mysql_secure_installation
55
56 IMPORTANT: mariadb defaults to strict mode of operation which will cause
57 some zoneminder database writes to fail. In order to turn this off -
58 which will be for the whole database - you will need to edit
59 /etc/my.cnf and comment out the record
60
61 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES and restart the
62 server
63
642. Using the password for the root account set during the previous step, you
65 will need to create the ZoneMinder database, assuming your database server
66 is local:
67
68 mysql -uroot -p < /opt/zoneminder/share/zoneminder/db/zm_create.sql
69 mysqladmin -uroot -p reload
70
713. The database needs a user. One is not created by default because this would
72 introduce an obvious security issue. The following should set this up:
73
74 mysqladmin -uroot -p reload
75 grant select,insert,update,delete,alter on zm.* to
76 'zmuser'@localhost identified by 'zmpass';
77
78 Obviously, change at least zmpass to an actual, secure password or
79 passphrase. You can change zmuser as well if you like.
80
814. Edit /etc/zm.conf and, at the bottom, change ZM_DB_PASS and perhaps
82 ZM_DB_USER to match.
83
845. Edit /etc/php5/apache2/php.ini, uncomment the date.timezone line, and add
85 your local timezone. For whatever reason, PHP will complain loudly if
86 this is not set, or if it is set incorrectly, and these complaints will
87 show up in the zoneminder logging system as errors.
88
89 If you are not sure of the proper timezone specification to use, look at
90 http://php.net/manual/en/timezones.php
91
926. This package probably does not work with SELinux enabled at the moment. It
93 may be necessary to disable SELinux for httpd, or even completely for
94 ZoneMinder to function. This will be addressed in a later release. Run
95
96 setenforce 0
97
98 for testing, and edit /etc/sysconfig/selinux to disable it at boot time.
99
1007. Now start the web server (as root):
101
102 systemctl enable apache2.service
103 systemctl start apache2.service
104
1059. You should immediately visit http://localhost/zm and secure the system if
106 it is network facing. To do this:
107
108 a) click Options, then System.
109 b) check OPT_USE_AUTH.
110 c) set AUTH_HASH_SECRET to a random string.
111 d) click Save and refresh the main browser window.
112 e) You should be prompted to log in;
113 the default username/password is admin/admin.
114 f) Open Options again, choose the newly visible Users tab.
115 g) click the admin user and set a password.
116 h) enable OPT_CONTROL on the Ssytem tab to enable ptz camera control.
117
11810. You should be able to start zoneminder by issuing the commands (as root):
119
120 systemctl enable zoneminder
121 systemctl start zoneminder
122
123
124Upgrades
125========
126
1271. Update /etc/zm.conf. Check for any new settings and update the version
128 information. Comparing /etc/zm.conf and /etc/zm.conf.rpmnew should help to
129 do this.
130
1312. Add the mysql ALTER permission to the zmuser account:
132
133 mysql -u root -p
134 use zm
135 grant alter, lock tables on zm.* to 'zmuser'@localhost;
136
137 Since this is an upgrade, the assumption is that the zmuser account already
138 has select, insert, update, and delete permission.
139
1403. You will need to upgrade the ZoneMinder database as described in the
141 manual. Only if the previous step was successful, may you run zmupdate like
142 so (as root):
143
144 /opt/zoneminder/bin/zmupdate.pl
145
146
1474. As mentioned in the OpenSuse notes you may need to change database values.
148 These steps may be run at any time (as root):
149
150 stop the current instance of zoneminder - systemctl stop zoneminder
151
152 ensure that all zoneminder processes have terminated:
153
154 ps -ef|grep zm
155 if you find any process still running issue a kill -9 for each
156
157 mysql -u root
158 use zm
159 update Config set DefaultValue = '/var/run/zoneminder'
160 where name = 'ZM_PATH_LOGS';
161 update Config set Value = '/var/run/zoneminder'
162 where name = 'ZM_PATH_LOGS';
163 update Config set DefaultValue = '/var/run/zoneminder'
164 where name = 'ZM_PATH_SOCKS';
165 update Config set Value = '/var/run/zoneminder'
166 where name = 'ZM_PATH_SOCKS';
167 update Config set DefaultValue = '/var/run/zoneminder'
168 where name = 'ZM_PATH_LOGS';
169 update Config set Value = '/var/run/zoneminder'
170 where name = 'ZM_PATH_SWAP';
171 commit;
172 exit
173
174
175 You can then restart zoneminder - systemctl start zoneminder
176
177