Synology SPK for DVR Record Engine

Downloads & Instructions
Post Reply
demonrik
Posts: 1293
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Synology SPK for DVR Record Engine

Post by demonrik »

NTC wrote:
Thu Jul 30, 2020 1:59 pm
drwxrwxrwx+ 37 http http 4096 Jul 29 14:50 .
drwxr-xr-x 13 root root 4096 Jul 29 14:48 ..
-rwxrwxrwx+ 1 hdhomerundvr users 49023 Jul 28 18:59 20200728.log
-rwxrwxrwx+ 1 hdhomerundvr users 42258 Jul 29 15:07 20200729.log
drwxrwxr-x 2 http http 4096 Jul 13 2019 Endeavour on Masterpiece
drwxrwxrwx+ 3 hdhomerundvr users 4096 Jul 29 14:39 Great Performances
-rwxr-x--- 1 hdhomerundvr http 1511164 Jul 2 02:00 hdhomerun_record
drwxrwxrwx+ 3 hdhomerundvr users 4096 Jul 24 13:34 Muscle Shoals to Music Row
drwxrwx--- 3 http http 4096 Jul 12 15:06 Saturday Night Live
drwxrwxrwx+ 2 http root 4096 Jul 4 10:29 Simply Ming
drwxrwx--- 3 http http 4096 Nov 14 2019 The 53rd Annual CMA Awards
drwxrwxrwx+ 3 http root 4096 Jul 18 21:59 The Johnny Cash Show
drwxrwxrwx+ 3 hdhomerundvr users 4096 Jul 18 17:30 This Old House
Actually - looking again...
Can you confirm if there is a difference between 'Simply Ming' and 'Saturday Night Live'
I notice one is owned as group root and the other http with different world permissions.
if you can see neither - then ignore this and follow the previous post ;)
But if you can see 'Simply Ming' epsiodes and NOT 'Saturday Night Live' then it could be that we need to simply either change the group via

Code: Select all

sudo chgrp -R users /volume/HDHomeRunDVR
and/or change the world permissions with

Code: Select all

sudo chmod -R a+wr /volume/HDHomeRunDVR
If you see 'Saturday Night Live' and not 'Simply Ming' then I'm confused :)

NTC
Posts: 23
Joined: Sat Apr 13, 2019 2:26 pm
Device ID: 10751B42

Re: Synology SPK for DVR Record Engine

Post by NTC »

demonrik wrote:
Thu Jul 30, 2020 4:24 pm
It's very odd that the new recordings don't show up but the old ones do.. I would have expected if anything the other way round.
To clarify, I can not see any recordings, old or new. Not with the app, or going to the Silicon Dust page (NAS-IP:59090). Going to "recording" on the TV app states ready to record, but when I record a new program, it does not show up. However the log file shows no errors, and when I SMB into the my NAS from my desktop, the recorded files are there.
demonrik wrote:
Thu Jul 30, 2020 4:24 pm
Might be worth seeing if doing a chown on the /volume1/HDHomeRunDVR to hdhomerundvr might fix it..

Code: Select all

sudo synopkgctl stop HDHomeRunDVR
sudo chown -R hdhomerundvr:http /volume1/HDHomeRunDVR
sudo synopkgctl start HDHomeRunDVR
Changing to hdhomerundvr:http to all files and folders fixed the problem. I can see new and old recordings on the TV app and via NAS-IP:59090. Not sure why the new install set new recordings with group users but can only be seen with group http.

Out of curiosity, with PuTTY there are some folders I can get into (i.e. Simply Ming) and some that gives me access denied. Not sure if that was the case even before I did the above chown command. Not that it matters as I can still control the folder and files within the app, through SMB, and Synology DMS file manager.

As always, thanks for you help.

demonrik
Posts: 1293
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Synology SPK for DVR Record Engine

Post by demonrik »

NTC wrote:
Fri Jul 31, 2020 9:33 am
Out of curiosity, with PuTTY there are some folders I can get into (i.e. Simply Ming) and some that gives me access denied. Not sure if that was the case even before I did the above chown command. Not that it matters as I can still control the folder and files within the app, through SMB, and Synology DMS file manager.
Am guessing you log in as you and not root
Therefore if you are not the user, or group, and the rest of world permissions are not set you won't get access to the folder unless you become root (sudo -i)
e.g.

Code: Select all

drwxrwx--- 3 http http 4096 Jul 12 15:06 Saturday Night Live[/ode]
if you're not http, or part of the http program then the last --- indicates you cannot read, write, or CD to the directory
but
[code]drwxrwxrwx+ 2 http root 4096 Jul 4 10:29 Simply Ming
allows everyone to CD to the directory and can read and write to it's contents (i.e. add files, and/or delete files which are also marked as a+w)

NTC
Posts: 23
Joined: Sat Apr 13, 2019 2:26 pm
Device ID: 10751B42

Re: Synology SPK for DVR Record Engine

Post by NTC »

Got it. Thanks!

demonrik
Posts: 1293
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Synology SPK for DVR Record Engine

Post by demonrik »

NEW PACKAGE AVAILABLE
  • Fixed installer to add RunAs and BetaEngine to existing config file during upgrade
  • Add fix to installer to clear out any record engines sitting in /tmp
  • UI Addition to read/modify the RunAs and BetaEngine parameters
  • Beta check disabled by default now
  • Ensure permissions right on the config file
To move to new package - simply do manual install of new package.

new SPK HDHomeRunDVR-1.0.1.spk available in the usual locations Google Drive, DropBox, OneDrive

Code is available on github
https://github.com/Silicondust/dvr_install

NTC
Posts: 23
Joined: Sat Apr 13, 2019 2:26 pm
Device ID: 10751B42

Re: Synology SPK for DVR Record Engine

Post by NTC »

Hi Rik, I installed 1.0.1 and lost access to my recordings again.

If you recall last week, I chown in the HDHomeRunDVR directory to hdhomerundvr:http and was able to see my recordings through the app and via the SiliconDust web page. After installation of 1.0.1 the owner:group for all my recordings were changed to 1027:http and I no longer can view recordings

Not sure who, or what 1027 is but I assume it is a UID, however it is not hdhomerundvr, which is 1028 on my machine, and http is 1023. Running the id command gives me 1027 no such user.

Running the synoacltool, I got this (the strange symbols is what I got on PuTTY, and line [2] is what got added after the upgrade)
ACL version: 1
Archive: has_ACL,is_support_ACL
Owner: ▒▒▒▒▒▒▒▒vyP▒▒v▒▒v▒▒▒v▒▒▒v▒▒▒~▒▒v4m▒v▒\▒vT▒v(user) not found
---------------------
[0] user:http:allow:rwxp-DaARWc--:fd-- (level:0)
[1] user:hdhomerundvr:allow:rwxpdDaARWc--:fd-- (level:0)
[2] user::allow:rwxpdDaARWc--:fd-- (level:0)
[3] group:administrators:allow:rwxpdDaARWc--:fd-- (level:0)
[4] group:http:allow:rwxpdDaARWc--:fd-- (level:0)

So, how do I fix this and view my exsiting recordings? Do I do a chown again?

Norm

EDIT: I forgot to mention that in DVR Manager the RunAs is set to hdhomerundvr

demonrik
Posts: 1293
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Synology SPK for DVR Record Engine

Post by demonrik »

NTC wrote:
Sat Aug 08, 2020 9:32 am
Hi Rik, I installed 1.0.1 and lost access to my recordings again.

If you recall last week, I chown in the HDHomeRunDVR directory to hdhomerundvr:http and was able to see my recordings through the app and via the SiliconDust web page. After installation of 1.0.1 the owner:group for all my recordings were changed to 1027:http and I no longer can view recordings

Not sure who, or what 1027 is but I assume it is a UID, however it is not hdhomerundvr, which is 1028 on my machine, and http is 1023. Running the id command gives me 1027 no such user.

Running the synoacltool, I got this (the strange symbols is what I got on PuTTY, and line [2] is what got added after the upgrade)
ACL version: 1
Archive: has_ACL,is_support_ACL
Owner: ▒▒▒▒▒▒▒▒vyP▒▒v▒▒v▒▒▒v▒▒▒v▒▒▒~▒▒v4m▒v▒\▒vT▒v(user) not found
---------------------
[0] user:http:allow:rwxp-DaARWc--:fd-- (level:0)
[1] user:hdhomerundvr:allow:rwxpdDaARWc--:fd-- (level:0)
[2] user::allow:rwxpdDaARWc--:fd-- (level:0)
[3] group:administrators:allow:rwxpdDaARWc--:fd-- (level:0)
[4] group:http:allow:rwxpdDaARWc--:fd-- (level:0)

So, how do I fix this and view my exsiting recordings? Do I do a chown again?

Norm

EDIT: I forgot to mention that in DVR Manager the RunAs is set to hdhomerundvr
hmmm... Odd
yeah - you need to re-chown the folders, e.g.

Code: Select all

sudo chown -R hdhomerundvr /volume1/HDHomeRunDVR
In the upgrade of the package it will remove the hdhomerundvr user and then re-add them.
I believe this is the root cause here - for some reason the UID on your system is incrementing which usually means the delete hasn't fully persisted before the add.. so the add sees the old UID is still there and thus increments to the next, while the user name was removed so it doesn't error that the user exists. This isn't the first time I've seen similar things happening on synology :(

I have an idea on how to fix for future. Should have new SPK later today to try, basically i'll prevent the remove/add of the user during upgrade.. also realize I should probably always chown the files in the RecordPath

NTC
Posts: 23
Joined: Sat Apr 13, 2019 2:26 pm
Device ID: 10751B42

Re: Synology SPK for DVR Record Engine

Post by NTC »

demonrik wrote:
Sat Aug 08, 2020 11:41 am
hmmm... Odd
yeah - you need to re-chown the folders, e.g.

Code: Select all

sudo chown -R hdhomerundvr /volume1/HDHomeRunDVR
In the upgrade of the package it will remove the hdhomerundvr user and then re-add them.
I believe this is the root cause here - for some reason the UID on your system is incrementing which usually means the delete hasn't fully persisted before the add.. so the add sees the old UID is still there and thus increments to the next, while the user name was removed so it doesn't error that the user exists. This isn't the first time I've seen similar things happening on synology :(

I have an idea on how to fix for future. Should have new SPK later today to try, basically i'll prevent the remove/add of the user during upgrade.. also realize I should probably always chown the files in the RecordPath
When the 1st time it didn't work, I remembered that I have to stop the record engine first. Once I did that and then chown, I got my recordings back.

As for your suggestions for future packages, they sound like logical precautions.

NTC
Posts: 23
Joined: Sat Apr 13, 2019 2:26 pm
Device ID: 10751B42

Re: Synology SPK for DVR Record Engine

Post by NTC »

I've thought about the UID 1027 that it created and was thinking that it could only have created it if all instances of user hdhomerundvr was removed. Otherwise, if it started adding hdhomerundvr before complete removal, wouldn't it have used the same UID? Just wondering.

demonrik
Posts: 1293
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: Synology SPK for DVR Record Engine

Post by demonrik »

NTC wrote:
Sat Aug 08, 2020 1:18 pm
I've thought about the UID 1027 that it created and was thinking that it could only have created it if all instances of user hdhomerundvr was removed. Otherwise, if it started adding hdhomerundvr before complete removal, wouldn't it have used the same UID? Just wondering.
1027 was the UID of the last successful install
When you upgraded this time it removed the hdhomerundvr user (1027) then created a new one (1028)
Anyway - please try 1.0.2 (should upload sometime in the next hour or so)
It will still do this delete/create this run, but will be fixed for next time.
It also will auto chown the record path folder to whoever is set as RunAs

Beerman
Posts: 1501
Joined: Thu May 21, 2015 7:05 pm

Re: Synology SPK for DVR Record Engine

Post by Beerman »

Working great for me. Thanks again for your time and effort into this project!

Post Reply