Project

General

Profile

Actions

Bug #6296

closed

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

Bug #6296: Run from terminal with option fork /-f/ create new configuration location

Added by saen acro almost 3 years ago. Updated almost 3 years 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

Updated by Oliver Schinagl almost 3 years ago Actions #1

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.

Updated by saen acro almost 3 years ago Actions #2

Ignore "-c" configuration patch if also included

Updated by saen acro almost 3 years ago Actions #3

@ user#3332
bundle script have some issues mentioned here #6274 with can be connected.

Updated by Flole Systems almost 3 years ago Actions #4

saen acro wrote:

@ user#3332
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.

Updated by Oliver Schinagl almost 3 years ago Actions #5

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?

Updated by Oliver Schinagl almost 3 years ago Actions #6

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?

Updated by saen acro almost 3 years ago Actions #7

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.

Updated by Flole Systems almost 3 years ago Actions #8

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.

Updated by saen acro almost 3 years ago Actions #9

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.

Updated by Flole Systems almost 3 years ago Actions #10

  • 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.

Updated by Der Depp vom Dienst almost 3 years ago Actions #11

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.

Updated by Oliver Schinagl almost 3 years ago Actions #12

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`.

Updated by Oliver Schinagl almost 3 years ago Actions #13

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.

Actions

Also available in: PDF Atom