QNAP QPKG for DVR Record Engine

Downloads & Instructions
Post Reply
demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

signcarver wrote: Thu Aug 05, 2021 9:20 pm That error often comes if /tmp is mounted as noexec but for some reason I thought this package moved such out of /tmp. I'd check fstab. I know a couple of years ago I saw a lot of updates to nas's doing this.
Package doesn't do it.. the binary self extracts out to /tmp
U could be right about noexec, but if it is then is a bummer cos the qnap won't save edits to fstab easily. Would be good to get a dump of /etc/fstab to confirm.

toricred6
Posts: 103
Joined: Sat Feb 15, 2020 8:59 am
x 2

Re: QNAP QPKG for DVR Record Engine

Post by toricred6 »

/tmp is not listed in fstab at all.

toricred6
Posts: 103
Joined: Sat Feb 15, 2020 8:59 am
x 2

Re: QNAP QPKG for DVR Record Engine

Post by toricred6 »

# /etc/fstab: static file system information.
#
# <file system> <mount pt> <type> <options> <dump> <pass>
/dev/ram / ext2 defaults 1 1
proc /proc proc defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

toricred6 wrote: Fri Aug 06, 2021 8:29 am # /etc/fstab: static file system information.
#
# <file system> <mount pt> <type> <options> <dump> <pass>
/dev/ram / ext2 defaults 1 1
proc /proc proc defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0
I think QNAP uses the RAM and builds a tmpfs drive..
So unless there is some weirdness it shouldn't have a noexec
How about check the output of mount (no parameters)
will get something like below

Code: Select all

 # mount
none on /new_root type tmpfs (rw,mode=0755,size=409600k)
/proc on /proc type proc (rw)
devpts on /dev/pts type devpts (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /tmp type tmpfs (rw,size=64M)
....
I don't think QNAP will add a noexec to the tmpfs line - but worth checking.

Also..
While you're there.. Can we check the following

Code: Select all

uname -m
Wondering what the CPU is reporting itself as.

toricred6
Posts: 103
Joined: Sat Feb 15, 2020 8:59 am
x 2

Re: QNAP QPKG for DVR Record Engine

Post by toricred6 »

mount:

none on /new_root type tmpfs (rw,mode=0755,size=696320k)
/proc on /proc type proc (rw)
devpts on /dev/pts type devpts (rw)
tmpfs on /tmp type tmpfs (rw,size=64M)
tmpfs on /dev/shm type tmpfs (rw)
tmpfs on /share type tmpfs (rw,size=16M)
tmpfs on /mnt/snapshot/export type tmpfs (rw,size=16M)
/dev/md9 on /mnt/HDA_ROOT type ext3 (rw,data=ordered)
cgroup_root on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/cgroup/memory type cgroup (rw,memory)
/dev/mapper/cachedev1 on /share/CACHEDEV1_DATA type ext4 (rw,usrjquota=aquota.user,jqfmt=vfsv0,user_xattr,data=ordered,data_err=abort,nodelalloc,nopriv,nodiscard,acl)
cpu on /sys/fs/cgroup/cpu type cgroup (rw,cpu)
/dev/md13 on /mnt/ext type ext4 (rw,data=ordered,barrier=1,nodelalloc)
none on /sys/kernel/config type configfs (rw)
tmpfs on /share/external/.nd type tmpfs (rw,size=1m)
tmpfs on /share/external/.cm type tmpfs (rw,size=1m)
tmpfs on /mnt/hm/temp_mount type tmpfs (rw,size=1m)
//192.168.1.203/HDHomeRunDVR on /share/external/.nd/1000/0a909b132-4185-4343-aa75-69046b0e9ad9 type cifs (rw)
tmpfs on /share/CACHEDEV1_DATA/.samba/lock/msg.lock type tmpfs (rw,size=48M)
tmpfs on /mnt/ext/opt/samba/private/msg.sock type tmpfs (rw,size=16M)

uname -m

aarch64

It looks to me that /tmp is set to rw only and not execute. That could be the problem. Of course I'm not an expert on *NIX.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

toricred6 wrote: Fri Aug 06, 2021 9:59 am ..
tmpfs on /tmp type tmpfs (rw,size=64M)
...
It looks to me that /tmp is set to rw only and not execute. That could be the problem. Of course I'm not an expert on *NIX.
Nope - this is perfectly correct.
You set noexec explicitly if you don't want it - you don't have to explicitly say exec
aarch64
This could be cause.. But I am surprised since the AL324 CPU has been used in other NASes.
However I have run in to issues with running armv7 compiled binaries on aarch64 before - so maybe something is suddenly raising it's ugly head between QNAP's kernels and the compiled binary.

One last thing you could try.
Copy the /tmp/hdhomerun_record_arm binary to another share e.g. /share/Public or similar
And then execute that and see if it gives you a version

Code: Select all

./hdhomerun_record_arm version
If you still get an unable to execute then its most likely something in the binary
If it runs, then there is clearly something in the NAS about executing from /tmp which we need to resolve..

At that point - I don't think there is much more I can do to help.
Will still look at what I can find about executing from /tmp, but really need someone from Silicondust to do some compatibility checking on the binary with this NAS/CPU combo and see what might be the cause.

toricred6
Posts: 103
Joined: Sat Feb 15, 2020 8:59 am
x 2

Re: QNAP QPKG for DVR Record Engine

Post by toricred6 »

Still won't run in /share/Public. Same error.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

toricred6 wrote: Fri Aug 06, 2021 11:38 am Still won't run in /share/Public. Same error.
Suggest you open a ticket with SD at this point - somewhere in line 10 of their binary they are doing something that I have no insight into.
AND/OR post a separate thread in viewforum.php?f=119

Include the specific QNAP model, and the CPU type (It's an Annapurna Labs Alpine AL324)
The output of uname -m
And the error exactly as provided.

NedS
Silicondust
Posts: 3146
Joined: Mon Dec 10, 2018 12:38 pm
x 163

Re: QNAP QPKG for DVR Record Engine

Post by NedS »

Got the support ticket. Thanks for the heads up, I will tell Nick about this.

toricred6
Posts: 103
Joined: Sat Feb 15, 2020 8:59 am
x 2

Re: QNAP QPKG for DVR Record Engine

Post by toricred6 »

I know this is a dumb question, but can I change the user that the record engine runs as? Or at least who the owner and group are that the files have?

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

toricred6 wrote: Mon Aug 09, 2021 11:00 am I know this is a dumb question, but can I change the user that the record engine runs as? Or at least who the owner and group are that the files have?
You can.
You can change the RunAs parameter in the UI to the username you want to use.
However - there is a process you will have to follow (below) to do this as I can't automate it easily.
Also - fwiw I think QNAP Will update for QTS5 similar rules to Synology did for DSM7, i.e. the package will have a user created and must be run with that user.

Anyway - here's the instructions.
1. stop the DVR engine via app center or command line
2. You need to remove the temporary files - the downloaded record engine binary in the Record Path, the log files, and the self extracted file in /tmp (/tmp/hdhome*) - this is important because these will be in owned by the old user, and will need them removed so the new user can overwrite them.
3. You need to make sure the new username has READ access to the CONF file - it's normally world readable - but worth checking

Code: Select all

ls -l $(getcfg HDHomeRunDVR Install_Path -f /etc/config/qpkg.conf)/HDHomeRunDVR.conf
4. Make the update by either editing the conf file, or via the UI to the user you want.
5. Ensure all the recordings in your RecordPath are owned by the new user - you may need to add the user to the share also.
6. start the DVR engine via app center or command line

Best of luck.

toricred6
Posts: 103
Joined: Sat Feb 15, 2020 8:59 am
x 2

Re: QNAP QPKG for DVR Record Engine

Post by toricred6 »

Does this package already work on QTS5? Also, what is the default password for hdhomerundvr?

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

toricred6 wrote: Wed Aug 11, 2021 8:56 am Does this package already work on QTS5? Also, what is the default password for hdhomerundvr?
QTS5 - Not known.. Like Synology I do not upgrade to beta's since I have only a single NAS and can't afford to brick it.

there is no password. it's not set with one.
Hence the user is disabled preventing logins.. The only way for anyone to use the user is to have higher level privileges to assume the role of the user - i.e. root or admin.

toricred6
Posts: 103
Joined: Sat Feb 15, 2020 8:59 am
x 2

Re: QNAP QPKG for DVR Record Engine

Post by toricred6 »

Do I need to put the password for the new user in the .conf file or somewhere else?

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: QNAP QPKG for DVR Record Engine

Post by demonrik »

toricred6 wrote: Wed Aug 11, 2021 12:00 pm Do I need to put the password for the new user in the .conf file or somewhere else?
Nope.
The qnap executes the script as admin, and the script then runs the DVR engine as the runas user. Since it is admin it doesn't need the password.

Post Reply