Project

General

Profile

Bug #6296

Run from terminal with option fork /-f/ create new configuration location

Added by saen acro over 1 year ago. Updated over 1 year ago.

Status:
Invalid
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-08-09
Due date:
% Done:

0%

Estimated time:
Found in version:
4.3-2149~g17eebbef5
Affected Versions:

Description

Under Alpine linux
started as

tvheadend -f

it create

/sbin/.config/hts# ls -al
total 40
drwx------ 7 daemon video 4096 Aug  9 09:00 .
drwx------ 3 daemon video 4096 Aug  9 00:03 ..
-rw-r--r-- 1 daemon video   22 Aug  9 09:00 .lock
drwx------ 2 daemon video 4096 Aug  9 00:03 bouquet
drwx------ 2 daemon video 4096 Aug  9 00:03 caclient
-rw------- 1 daemon video 1647 Aug  9 00:03 config
drwx------ 3 daemon video 4096 Aug  9 00:03 dvr
-rw------- 1 daemon video   79 Aug  9 09:00 epgdb.v3
drwx------ 3 daemon video 4096 Aug  9 00:03 input
drwx------ 2 daemon video 4096 Aug  9 00:03 profile

user "daemon" group "video"

if started without "-f" use regular

/root/.config/hts

user "root" group "root"
root is only user on OS

Similar behavior in CentOS

History

#1

Updated by Oliver Schinagl over 1 year ago

Let me see if I can reproduce this. But it looks like this relates to the XDG changes. afaik the code will try its best to find a reasonable path, but failing everything else, it'll use the CWD. Since before the XGD changes, the path was hardcoded, it could be that the `-f` flag 'skips' something somewhere.

#2

Updated by saen acro over 1 year ago

Ignore "-c" configuration patch if also included

#3

Updated by saen acro over 1 year ago

@ Oliver Schinagl
bundle script have some issues mentioned here #6274 with can be connected.

#4

Updated by Flole Systems over 1 year ago

saen acro wrote:

@ Oliver Schinagl
bundle script have some issues mentioned here #6274 with can be connected.

Lol, no. A missing close or different sleep call is not the issue here.

#5

Updated by Oliver Schinagl over 1 year ago

I think we'll have to close this issue with 'not-a-bug'.

When you launch tvheadend with the `-f` flag, it gets run as a daemon in the background. To do so, tvheadend drops permissions/changes permissiosn to UID 2 (on my alpine container anyway) which resolves to the user `daemon:x:2:2:daemon:/sbin:/sbin/nologin`.

From here on the issue is clear as day. The 'daemon' user's homedir is set to '/sbin' and thus, we'll use '/sbin' to store our files. It's defiantly not nice but works as expected.

Now, I don't think it's a bad idea, to require `--config` when `-f` is set. I don't think it's a good idea to hardcode the path to X in the case of `-f`, because what is the correct path in such a case?

#6

Updated by Oliver Schinagl over 1 year ago

Thinking a little more about this, the logic to determine the config dir would need to be improved. Right now, it assumes it can use /var/lib/tvheadend if it matches the currently running user.

E.g. if the owner of /var/lib/tvheadend is root, but we launch with -f (which we launch with user daemon) there will be a missmatch.

So sean, can you list /var/lib/tvheadend ownership, and see if it works if you? Seems to work here.

As for UX, I wonder what makes more sense. "Normally" a distro maintainer would install TVHeadend and create the proper folders and proper startup files.

How did you install tvheadend from the deb? Does the deb do it properly?

#7

Updated by saen acro over 1 year ago

Im not using docker pseudo virtualization,
Im installed Alpin Linux on bear metal x86 embedded board,
this save around 1,5Gb blob, and have full functional OS
under 150mb + developer tools needed to compile tvheadend.

Folder /var/lib/tvheadend not exist.

Bundle idea is to have aio binary.
And logically configuration location
to be in user /witch run it/ home folder
or specified location,
or in same directory with binary.

#8

Updated by Flole Systems over 1 year ago

Well you are running Tvheadend as user "daemon", and home directory is /sbin for that user. It works exactly how you want it to work.

#9

Updated by saen acro over 1 year ago

Flole Systems wrote:

Well you are running Tvheadend as user "daemon", and home directory is /sbin for that user. It works exactly how you want it to work.

Stop flooding and start reading!
Starting with "-f -c /some/location" ignore "-c" option.
No other error except Aborted
So not work how I wont it to work. Verstehen?

If we accept that home path is /sbin
and start it with "-C",
in browser show Error 403.

#10

Updated by Flole Systems over 1 year ago

  • Status changed from New to Invalid

You are "flooding" and not reading and I am super close to banning you for your continued useless comments, attacks and unacceptable behavior.

#11

Updated by Anonymous over 1 year ago

Flole Systems wrote:

You are "flooding" and not reading and I am super close to banning you for your continued useless comments, attacks and unacceptable behavior.

After 4 years your learning curve starts here.

#12

Updated by Oliver Schinagl over 1 year ago

I'll just ignore this totally inappropriate rude behavior ...

But I also think you are doing something wrong.

```
mkdir -p /tmp/hts
/src # /tvheadend/usr/local/bin/tvheadend -f -l /tmp/tvheadend.log -c /tmp/hts
2023-08-13 08:52:42.226 [ INFO]:config: Using configuration from '/tmp/hts'
```

Without the `-c` flag it does what I wrote before, it resolves the `daemon` user home, which is `/sbin`.

#13

Updated by Oliver Schinagl over 1 year ago

Flole, close this issue, as I can't find anything wrong here.

I've created https://github.com/tvheadend/tvheadend/pull/1561 to make this more clear however to the user.

Also available in: Atom PDF