Can't enable DVR

Hi. I'm troubleshooting why recordings aren't happening and I decided to restart the DVR services. However, when I try to re-enable, it's telling me: " Error: no write permissions on dvr directory".

37%20AM

My recordings directory is NFS mounted to a QNAP NAS and I gave it write permissions from my channels VM. Both the channels-dvr and recordings folders are installed/mounted on my home directory. I am able to go into the recordings directory and create a file, verifying that my user ID has write permissions. The logs don't say anything.

etang@channels:~$ pwd
/home/etang
etang@channels:~$ ls -l
total 12
drwxrwxr-x  4 etang etang 4096 Jan 14 20:58 channels-dvr
drwxrwxrwx 11 etang etang 4096 Feb 22 15:10 recordings
etang@channels:~$ cd recordings/
etang@channels:~/recordings$ pwd
/home/etang/recordings
etang@channels:~/recordings$ touch test
etang@channels:~/recordings$ ls -l
total 44
drwxr-xr-x 32 etang etang  4096 Jan 28 13:10 Database
drwxr-xr-x  2 etang etang 12288 Jan 28 17:56 Images
drwxr-xr-x  3 etang etang  4096 Feb  4  2017 Logs
drwxr-xr-x  3 etang etang  4096 Jan 10 23:01 Movies
drwxr-xr-x  2 etang etang  4096 Dec 21 00:09 @Recently-Snapshot
drwxrwxrwx  3 etang etang  4096 Feb  3  2017 @Recycle
drwxr-xr-x  7 etang etang  4096 Jan 29 01:42 Streaming
-rw-rw-r--  1 etang etang     0 Feb 22 15:10 test
drwxr-xr-x 49 etang etang  4096 Jan  8 04:13 TV
etang@channels:~/recordings$

Channels DVR is running as your UID? What are you running the DVR software on?

It looks like it

etang@channels:~/recordings$ ps aux | grep channels
etang      1046  0.0  0.5 584648 22392 ?        Ssl  15:02   0:00 /home/etang/channels-dvr/latest/channels-dvr
etang      1923  0.0  0.0  13136  1036 pts/0    S+   15:22   0:00 grep --color=auto channels

DVR software is running on a Ubuntu 18.04 VM.

Hmmm... Everything looks right from here. Is Channels DVR on your Ubuntu box running SUID/SGID? Or is the software, itself, firing-up as root and changing perms after-the-fact? If the latter: It may be trying to open those files while it's still root, which, unless the proper options have been set in the NFS export, will fail.

Admittedly, that is beyond my linux expertise. I installed the DVR software following the install instructions. Do you think a re-install would help?

What does the permissions of a normal recordings directory look like? Is it owned by root or the user? What about the directories/files within the recordings directory?

I re-installed everything and it looks like it worked. I'm able to re-enable the DVR service now. Thanks for your help.

2 Likes

Sorry, right after my last answer I went out to run an errand of sorts. Glad to see you got it going.

As to whether it fires-up as root then drops its permissions to an unprivileged user: The Channels devs can answer that. But, generally speaking, if it's started in init, doesn't appear to run as root, and doesn't have suid/sgid bits (you can see those with an ls -l of the executable), then it's starting as root and dropping root privileges sometime after startup. It may do that immediately, or may "do things" before doing that.

If one of those things it does is try to access NFS-mounted filesystems lacking having been exported with root permissions (the default, these days), then there'd be a problem.

Doesn't sound like that was the problem, or it'd remain after the reinstall. Short of that, the only way to debug it possibly would've been by strace'ing it. That's an advanced debugging thing and would require somebody who understands *nix system call and file semantics to interpret.

1 Like