FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Location
    Island of Roatan in the Caribbean
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    zoneminder/4TB drive/systemd issues

    I believe what I'm about to describe has to do with systemd.

    Everything below is with selinux disabled as zoneminder and selinux don't get along at all.

    After much finagling, I have zoneminder willing to come up and I can hit it from a web browser.

    I want it to save its files to a 4TB drive. So, I mount (via fstab) a 4TB drive @ /var/lib/zoneminder.

    The drive mounts fine and Apache puts a temp directory there, but prior to the mount, the zoneminder directory was owned by apache.apache. After the mount it is owned by root.root for some reason. So, I chown it back to apache.apache, bounce the box and that mount point is still owned by apache.apache. However, zoneminder won't come up.

    If I remove the drive from fstab and bounce the box, zoneminder comes up. If I have the drive as part of fstab it won't. The actual failure is recorded as:
    root@airportserver lib# systemctl status zoneminder.service
    zoneminder.service - Video security and surveillance system
    Loaded: loaded (/usr/lib/systemd/system/zoneminder.service; enabled)
    Active: failed (Result: exit-code) since Mon 2013-09-16 13:16:00 CST; 19s ago
    Process: 2212 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=255)

    Sep 16 13:15:49 airportserver.private.ycc systemd[1]: Starting Video security and surveillance system...
    Sep 16 13:15:50 airportserver.private.ycc zmpkg[2212]: INF [Command: start]
    Sep 16 13:15:50 airportserver.private.ycc su[2222]: (to root) root on (null)
    Sep 16 13:15:50 airportserver.private.ycc su[2231]: (to root) root on (null)
    Sep 16 13:15:50 airportserver.private.ycc su[2237]: (to root) root on (null)
    Sep 16 13:15:50 airportserver.private.ycc su[2243]: (to root) root on (null)
    Sep 16 13:16:00 airportserver.private.ycc zmpkg[2212]: ERR [Unable to run "su apache --shell=/bin/sh --command='/usr/bin/zmdc.pl star...rver"]
    Sep 16 13:16:00 airportserver.private.ycc systemd[1]: zoneminder.service: control process exited, code=exited status=255
    Sep 16 13:16:00 airportserver.private.ycc systemd[1]: Failed to start Video security and surveillance system.
    Sep 16 13:16:00 airportserver.private.ycc systemd[1]: Unit zoneminder.service entered failed state.
    root@airportserver lib# su apache --shell=/bin/sh --command='/usr/bin/zmdc.pl startup'

    The failure doesn't appear to have anything to do with the drive mount, but it has to be responsible because if I remove the drive and boot everything is fine.

    How can a drive mount cause this? With selinux out of the way, what besides normal rights can have such an effect? Does systemD use any of the selinux directory properties as part of its operations even when selinux is disabled?

  2. #2
    Join Date
    Sep 2013
    Location
    USA
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: zoneminder/4TB drive/systemd issues

    The original /var/lib/zoneminder as created by the zoneminder package script sets the ownership to apache:apache due to it's requirements. When you mount a new drive/device on top of that folder, you're doing it as root/superuser privs., hence why it switches to being owned by root:root.

    As far as SELinux issues, I also have this disabled on my camera box with no issues, so I doubt that is the case if you also have it disabled. Inside /var/lib/zoneminder should be two folders, "events" and "images". Did you re-create those folders when you mount the bigger drive? If not, Zoneminder may fail when it can't find those folders to write into.

    What you may want to look into is bind mounting a directory. Bind Mounts Explanation. Basically, format your hard drive with whatever filesystem you're going to use, create a few folders in it, then bind mount those onto Zoneminder's default ones.

    For /etc/fstab, bind mounting would have a line like the following:
    /opt/bigdrive/events /var/lib/zoneminder/events none bind 0 0

    And another one for images. Doing this, I haven't run into those issues you appear to be having, and I don't have to worry about a package update wiping out symlinks or other settings. I've been running this on a RAID6 20TB XFS zm storage array bind mounted on top of a 80GB RAID1 OS array.

  3. #3
    Join Date
    Feb 2009
    Location
    Island of Roatan in the Caribbean
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: zoneminder/4TB drive/systemd issues

    I never heard of bind mount before. Thanks for the heads up.

    It's possible I have my sequence of events wrong, but I installed Zoneminder but never started it. I then did my mount of the large drive and started apache. It created a temp directory on the new drive. Then I started zm for the first time and it failed.

    I removed the new drive and started zm just fine.

    Since then, I've figured out a work around. I simply duplicated the structure zm made at the real zoneminder directory while I had the other drive mounted at /media. Now I can boot the box and zm is up.

    I wasn't aware of how the mount created a NEW directory at the mount point. I though it used the existing directory and just hung the space below that. Live and learn.

Similar Threads

  1. Zoneminder not streaming
    By gundark in forum Using Fedora
    Replies: 3
    Last Post: 9th May 2014, 04:56 PM
  2. systemd and systemd-ask-password
    By cheerio158 in forum Installation, Upgrades and Live Media
    Replies: 0
    Last Post: 23rd September 2012, 03:03 PM
  3. Replies: 1
    Last Post: 25th January 2012, 02:35 AM
  4. Has Anyone Installed Zoneminder?
    By carlwill in forum Using Fedora
    Replies: 7
    Last Post: 20th December 2007, 04:07 AM
  5. Replies: 3
    Last Post: 22nd October 2006, 08:48 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •