1.26.5 upgrade fails when events and images are links. Why?

Forum for questions and support relating to the 1.26.x releases only.
Locked
TheKorn
Posts: 142
Joined: Fri Aug 02, 2013 12:39 pm

1.26.5 upgrade fails when events and images are links. Why?

Post by TheKorn »

So I just upgraded my (perfectly stable and working great) 1.25 zoneminder to 1.26.5.

It went relatively smoothly, except I had to do some gymnastics in order to get it to install.

(using the iconnor PPA, in case it matters)


I had /usr/share/zoneminder/events and /usr/share/zoneminder/images symlinked to a convenient place before I started the upgrade. This then brought up a large warning and the installer refused to proceed when I tried to upgrade.

So I renamed the symlinks, made new symlinks where zoneminder "expected" them to point to (i.e. to empty directories since they never had events in them), then had to force runlevel=1 when upgrading so that zoneminder wasn't re-started upon upgrading. Then I put the original symlinks back, and started the new zoneminder.

...it worked flawlessly. 1.26.5 running happy as a clam, all old archived events present (and not being deleted by zmfilter, either). No problems!

So I guess the question is why is zoneminder checking (and balking!) at custom symlinks on install? It's obvious somebody went to a great deal of trouble to write that code (and I had to do work to get around it), to no effect. I'm thinking I have to be missing something; somebody clue me in here! Thanks!
pyroman
Posts: 25
Joined: Fri Jan 03, 2014 6:40 pm

Re: 1.26.5 upgrade fails when events and images are links. W

Post by pyroman »

As stated in a number of posts and documents, it is better not to use symlinks. It is also mentioned somewhere that the installer will stop if non-standard symlinks are used.

One recommended method is to mount the two directories like this (in my system my drive was sdb1):

These lines in fstab could allow you to bind-mount an alternate location

==========================================================
/dev/sdb1 /data_storage ext4 defaults 0 2
/data_storage/zoneminder/images /var/cache/zoneminder/images none bind
/data_storage/zoneminder/events /var/cache/zoneminder/events none bind
===================================================

mount the drive normally, make the required directories, then put the above in /etc/fstab.
Make sure to edit the drive and folders to match your installation.
Then remount the drive.

I used this on ubuntu 10.04
TheKorn
Posts: 142
Joined: Fri Aug 02, 2013 12:39 pm

Re: 1.26.5 upgrade fails when events and images are links. W

Post by TheKorn »

pyroman wrote:As stated in a number of posts and documents, it is better not to use symlinks. It is also mentioned somewhere that the installer will stop if non-standard symlinks are used.
Right, but "why does it stop?" is the original question! (The question can't be an answer to itself!) Relatedly, why is it better to not use symlinks? It can't be that zm doesn't follow symlinks there, because the default installations for 1.25 and 1.26.5 are symlinks to begin with! (Even more telling, the documentation for 1.24 recommends symlinking, so something had to have changed!)

With renewed interest, I went digging through the search results for "link" on the wiki. Found the answer in result 43:
Note: It was recommended to use ln -s /newdrive/events /usr/share/zoneminder/events to link the new partition in. However, at least with the debian and ubuntu packages, upgrading zoneminder later will delete these symlinks and create new dirs. This will result in all your existing events being removed from the database. Update: debian's upgrader will now (v.1.25) abort if it detects a symbolic link instead of silently deleting it.
Well, there's the answer. I'll probably will stop using a symlink and instead use a bind mount for future upgrades. When I get around to it, no hurry apparently! :D
pyroman
Posts: 25
Joined: Fri Jan 03, 2014 6:40 pm

Re: 1.26.5 upgrade fails when events and images are links. W

Post by pyroman »

The only "why" I found is the same paragraph you found :)

I have similar questions as you but I'm not the one who knows the "deep" answer :)

knnniggett would know.
Locked