Not able to login when tvheadend running as a services

Added by Frank - about 1 year ago

Hi guys,

I have run into a small issue on my tvheadend setup in fedora....

When I start tvheadend normal ./tvheadend i can login to it, but if I run it as a services like ./tvheadend -f I am promted with the login screen, but it wont accept my user.

in my accesscontrol folder I have a file 7xxxx something and in here I got this {
"index": 1,
"enabled": true,
"username": "admin",
"prefix": "0.0.0.0/0,::/0",
"streaming": true,
"adv_streaming": true,
"htsp_streaming": true,
"profile": [
],
"dvr": true,
"htsp_dvr": true,
"all_dvr": true,
"all_rw_dvr": true,
"failed_dvr": true,
"dvr_config": [
],
"webui": true,
"admin": true,
"conn_limit_type": 0,
"conn_limit": 0,
"channel_min": 0,
"channel_max": 0,
"channel_tag_exclude": false,
"channel_tag": [
],
"comment": "Default access entry"

vi 798f3526b2eed62177235797eb6dda61

I have also added a extra user, in the gui but I cannot login with that either.

So what are I am doing wrong here, and what can I do to fix this so this will run as a services?? :)


Replies (25)

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

Are you running a packaged version or building yourself?
Does the user you are running TVHeadend as have a .hts folder in their home directory
Have you tried running the binary with the -C (first run) flag to create the default configuration?
If you've tried the above and also have a .hts folder, kill any instances of the tvheadend binary, delete the .hts folder for the user running tvheadend (I'll assume it's your current user) then run

tvheadend -C

...to start tvheadend and create the default configuration data (no user/no pass so use extreme caution if your box is exposed to the internet).

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

Ok I now deleted all files in the .hts folder and started tvheadend by using ./tvheadend -C created 2 users, in there.

Then I exited the gui, stopped the services, and killed the process, started the services again with ./tvheadend -F so it would run as a services in the background, now I cannot login.

I am using fedora and I have installed this packaged. https://copr.fedorainfracloud.org/coprs/dani/tvheadend/

so what are I doing wrong here?? need to find a solution here so I can have the application run as a services in the background, so I can terminate my ssh. :)

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

I'm not familiar with Fedora but what I'm confused about is why you are running the binary via ssh rather than starting the service via your distributions service manager (again forgive me as Fedora is one distro I've not used). Your example shows you running the tvheadend binary but also you mention stopping services - if you run tvheadend interactively (via ssh) there are no services so I don't understand that bit.

For example, in Debian/Ubuntu, TVHeadend is started by running;

sudo systemctl start tvheadend

or

sudo service start tvheadend

or

sudo /etc/init.d/tvheadend start

So what is the Fedora equivalent of that? You can start it via the command line in Debian/Ubuntu but it doesn't generally survive a log out of ssh as you are finding.

I'm downloading a Fedora ISO at the moment to try installing tvheadend and see how I get on.

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

mmm looks like Fedora uses systemd too so you should be able to control tvheadend using systemctl as per the above.

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

That is correct that I can use sudo systemctl start tvheadend but when I do this, it wont accept my login. Just like when I do ./tvheadend -F

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

But let me know if you can get it work in fedora, then I will just try to reinstall the application :)

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

I think that package is broken. On a fresh install with only the tvheadend package from the repository above (which is very old!) fails to start. Looking into the systemd script, it is expecting a config file at /home/tvheadend/config which never gets created.

I'm just setting up the build environment in the Fedora VM and I'll see if I can build it for you.

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

and you are running version 24 ?? that is the version that I am running :) latest and greates.. :)

But thanks for your help here. :)

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

The package is most certainly broken and I cannot get tvheadend to come up using systemd but I can get it to work as a daemon which means you can start it via ssh and then log out and it will stay up.

This might see you through until I/you/someone else can fix the systemd service;

Clear down the current config for your CURRENT and tvheadend users;

sudo rm -rf /home/tvheadend/.hts
sudo rm -rf /home/YOURUSERNAME/.hts

Start the tvheadend binary in 'firstrun' mode using your real login using;

tvheadend -C

Kill the tvheadend binary (CTRL+C) - no need to do any config at this point

Move the config directory from your current user to the tvheadend user;

sudo cp -R /home/YOURUSER/.hts /home/tvheadend

Fix the permissions on the .hts directory;

chown -R tvheadend:tvheadend /home/tvheadend/.hts

Start tvheadend with the following command;

/bin/tvheadend -f -p /var/run/tvheadend.pid -c /home/tvheadend/.hts/tvheadend -u tvheadend -g tvheadend -6 --http_port 9981 --htsp_port 9982

You should then see tvheadend running on http://YOURIP:9981 and be able to access the webui without a username/password. Then create a user and matching password and then you can log in.

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

I'll continue to try and get it to work with systemd when I have some time.

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

gosh that toke me some time to fix this on my installations. :) I found out that the .hts was installed in /root/ dir so had to move it etc. :)

But I got it fixed now.... So what if I reboot the server, will the services start auto now or will have to login and start the services? :)

Thanks for your help so far. :)

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

If you reboot tvheadend will need starting manually - something is not working between the systemd script and the tvheadend binary, no matter what options I put into the systemd script, it seems to crash immediately yet the same values in bash work absolutely fine.

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

Seems like a very poor release.. wondering if a ubuntu installation is better here???

RE: Not able to login when tvheadend running as a services - Added by Mark Clarkstone about 1 year ago

Jonathan Thomson wrote:

If you reboot tvheadend will need starting manually - something is not working between the systemd script and the tvheadend binary, no matter what options I put into the systemd script, it seems to crash immediately yet the same values in bash work absolutely fine.

If you're sure it's crashing and not just bailing because something is missing, try catching the crash output (install corekeeper if fedora has it) and open an issue.

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

Not sure it's a TVH issue Mark as it runs in standalone (and daemon) mode just not when launched via systemd - systemd reports tvheadend crashed but I'm not sure it ever started (as no pid file is created).

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

Frank - wrote:

Seems like a very poor release.. wondering if a ubuntu installation is better here???

Yes if you've no particular persuasion to Fedora then if you switch to Debian or Ubuntu you will find it much easier to get support (and indeed bang-up-to-date releases in the official TVHeadend repositories).

Shout if you need any help but the Ubuntu/Debian route will almost certainly be easier all round :)

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

Year I do follow you here, and this is not a issue since I am running vmware.. :)

I will install a ubuntu server, and install tvheadend in here instead. :)

I will let you know when I am done.

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

Ok I now got the tvheadend up and running on my ubuntu.... and I can do a sudo service tvheadend start and I can login :)

One thing I notices is the latest version 4.0.9 or I am missing somehting here??

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

Only the stable branch is available in the official repositories. Follow this wiki article to add the unstable (4.1) branch to apt.

Substitute "DISTRO" with the codename of your build (i.e. "jessie" for debian or "trusty" for ubuntu) and "BUILDTYPE" with "unstable" when you follow the instructions.

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

is there something I can setup so it will startup auto if I reboot the server etc.??

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

It should automatically do that if you install through the repositories - I think it installs a script in /etc/init.d which should handle that.

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

Ahh so it´s the stable I am running right now, that is also ok :)

I just reboot the server, and the service diid not start automatic... and I installed tvheadend from the official site. :)

I will have a look in the etc/init.d folder for this.. :)

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

Right there is a script here, but how does this work?? :)

RE: Not able to login when tvheadend running as a services - Added by Jonathan Thomson about 1 year ago

Run the following;

sudo update-rc.d tvheadend defaults

RE: Not able to login when tvheadend running as a services - Added by Frank - about 1 year ago

Perfect now we are getting there .... :)

also updated to version 4.1 so let´s see how that is running. :)

(1-25/25)