Difference between revisions of "Ubuntu Server 14.10 64-bit server with Zoneminder to use systemd"

From ZoneMinder Wiki
Jump to navigationJump to search
m
Line 61: Line 61:


CTRL+o to save the file
CTRL+o to save the file
CTRL+x to exit nano
CTRL+x to exit nano
'''IMPORTANT:''' If ZoneMinder complains on startup that the /var/run/zm folder is missing, that means you have skipped this step!


9. Change permissions on the file
9. Change permissions on the file

Revision as of 09:43, 5 December 2014

This is a how-to for setting up Ubuntu 14.10 server with Zoneminder to use systemd.

By default, init is enabled in Ubuntu 14.10. You may install and run Zoneminder without making any changes to how programs are started. However,

Ubuntu will, in time, move to systemd. So it is a good idea to know how to make Zoneminder work!

1. Install Ubuntu 14.10 server including LAMP Server and OpenSSH Server.

2. Install Zoneminder. You may use either the install procedures for any of the supported versions but we did this with ZM 1.28.0 from the iconnor

PPA. http://www.zoneminder.com/wiki/index.php/Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.28.0_the_easy_way

Note: We will explore installing Zoneminder on a system already running systemd as time permits and post the results in this WIKI.

3. Log into Ubuntu and become root

  sudo su

4. Install additional systemd components

  apt-get install systemd-sysv

5. Re-boot the server. Log back in as root

6. Check that systemd is running

  ps -p 1 -o comm=   should return systemd

7. Create a file called zoneminder.service

  nano /lib/systemd/system/zoneminder.service

Paste or enter the following:

 # ZoneMinder systemd unit file
 # This file is intended to work with all Linux distributions
 [Unit]
 Description=ZoneMinder CCTV recording and security system
 After=network.target mysql.service apache2.service
 Requires=mysql.service apache2.service
 [Service]
 User=www-data
 Type=forking
 ExecStart=/usr/bin/zmpkg.pl start
 ExecReload=/usr/bin/zmpkg.pl restart
 ExecStop=/usr/bin/zmpkg.pl stop
 PIDFile="/run/zm/zm.pid"
 [Install]
 WantedBy=multi-user.target

CTRL+o to save the file CTRL+x to exit nano

8. Create a file called zoneminder.conf

 nano /etc/tmpfiles.d/zoneminder.conf

Paste or enter the following

 d /var/run/zm 0755 www-data www-data

CTRL+o to save the file

CTRL+x to exit nano

IMPORTANT: If ZoneMinder complains on startup that the /var/run/zm folder is missing, that means you have skipped this step!


9. Change permissions on the file

 chmod 755 /etc/tmpfiles.d/zoneminder.conf

10. Enable Zoneminder

  systemctl enable zoneminder.service

11. Start Zoneminder

  systemctl start zoneminder.service

12. Check to see that Zoneminder is running

  systemctl status zoneminder.service

Thanks to Isaac Connor, Andrew Bauer and Carla Schroder for the pieces that allowed this puzzle to go together.