Unifi Video installed on Debian is setup to record to a remote filesystem.
The unifi-video service is started before the remote filesystem is mounted. unifi-video fails silently after the remote filesystem has mounted in that it neither keep recordings nor does it notify the user that it is failing to persist recordings.
Delay the start of the unifi-video service until after the remote filesystem has been mounted.
To do so, make note of the remote filesystem to which you wish to save recordings, then modify unifi-video’s init script and make it wait until that filesystem has been mounted.
By /etc/fstab, I’m mounting /video by NFS.
192.168.2.150:/video /video nfs rw,async,hard,intr,noexec,_netdev 0 0
The following command returns 0 if the above has been mounted; 1 otherwise.
grep "192.168.2.150:/video /video nfs4" /proc/mounts
As such, unifi-video’s init script can be modified to start only if the aforementioned test passes.
The script is at /etc/init.d/unifi-video
Add the following after start) while keeping the same indention level as the following code (in that file).
count=0 while ! grep "192.168.2.150:/video /video nfs4" /proc/mounts do sleep 1 count=`expr $count + 1` if test $count -eq 30 then log_failure_msg "(the remote datastore is not mounted)" exit 1 fi done
Then execute the following to reload the init script.
At this point it is a good idea to reboot the server, then execute the following to ensure unifi-video is able to start.
service status unifi-video