Project

General

Profile

Tvheadend 2.12 - Settings can not be stored?

Added by Super Grover about 13 years ago

Hello,

i have build a tvheadend package for mandriva linux and averything works fine for me. I can scan my DVB-T Stick, can mapping the located channels and so on, everything without a problem. BUT After restarting the daemon (init script) or rebooting the system all my settings are lost.

Here an other simple example: I create a new password protected admin account and after that I deactivate the "default access entry" and resign me over the WebUI, here the output of the error messages:

Oct 03 14:08:08 HTTP: 127.0.0.1: /comet/poll -- 401
Oct 03 14:08:38 HTTP: 127.0.0.1: /static/extjs/resources/images/default/window/left-corners.png -- 401
Oct 03 14:08:38 HTTP: 127.0.0.1: /static/extjs/resources/images/default/window/right-corners.png -- 401
Oct 03 14:08:38 HTTP: 127.0.0.1: /static/extjs/resources/images/default/window/top-bottom.png -- 401
Oct 03 14:08:38 HTTP: 127.0.0.1: /static/extjs/resources/images/default/window/left-right.png -- 401
Oct 03 14:08:38 HTTP: 127.0.0.1: /static/extjs/resources/images/default/button/btn-sprite.gif -- 401
Oct 03 14:08:38 HTTP: 127.0.0.1: /static/extjs/resources/images/default/qtip/bg.gif -- 401
Oct 03 14:08:38 HTTP: 127.0.0.1: /static/extjs/resources/images/default/progress/progress-bg.gif -- 401

Is this a Bug or has anybody a idea how to fix this problem? Thanks in advance.


Replies (6)

RE: Tvheadend 2.12 - Settings can not be stored? - Added by Hein Rigolo about 13 years ago

how do you start tvheadend in the init script? so what options do you start if with? using what user?

tvheadend stores its settings data in the .hts directory in the home directory of the user that is starting tvheadend.

RE: Tvheadend 2.12 - Settings can not be stored? - Added by Super Grover about 13 years ago

Thanks for your feedback.

"how do you start tvheadend in the init script"

After the RPM-Package installation I must start the service manually by typing the command

# service tvheedend start
as root . I have take the init script from a clearos package, here it is

$ cat /etc/rc.d/init.d/tvheadend 
#!/bin/bash 
# 
# tvheadend startup script 
# 
# chkconfig: 2345 99 01 
# description: Tvheadend  is a TV streaming server for Linux 
# processname: tvheadend 
# pidfile: /var/run/tvheadend.pid 

# Source function library. 
. /etc/init.d/functions 

prog="tvheadend" 

start() { 
    gprintf "Starting %s: " "$prog"     
    daemon tvheadend -u tvheadend -f -C 
    RETVAL=$? 
    echo 
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/tvheadend 
    return $RETVAL 
} 

stop() { 
    gprintf "Stopping %s: " "$prog" 
    killproc tvheadend 
    RETVAL=$? 
    echo 
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/tvheadend 
    return $RETVAL 
}     

case "$1" in 
  start) 
      start 
    ;; 
  stop) 
      stop 
    ;; 
  restart) 
      stop 
    start 
    ;; 
  status) 
    status tvheadend 
    ;; 
  condrestart) 
      [ -f /var/lock/subsys/tvheadend ] && $0 restart || : 
    ;; 
  *) 
    gprintf "Usage: %s {start|stop|status|restart|condrestart}\n" "$0" 
    exit 1 
esac 

"What options do you start with? using what user?"

If I start tvheadend with my user over the webintrerface "http:localhost:9981" there comes a login dialog but I have no login data (Username/password) so I start tvheadend with the option -C. By the way the permissions from the .hts directory and all subdirectories are 700? Are this permissions correct?

$ ls -lF ~/.hts/tvheadend/ 
total 4 
drwx------ 2 mado mado 4096 2011-10-04 07:55 accesscontrol/ 
[mado@localhost ~]$ ls -l ~/.hts/ 
total 4 
drwx------ 3 mado mado 4096 2011-10-04 07:55 tvheadend/ 
[mado@localhost ~]$ ls -l ~/.hts/tvheadend/ 
total 4 
drwx------ 2 mado mado 4096 2011-10-04 07:55 accesscontrol/ 
[mado@localhost ~]$ ls -l ~/.hts/tvheadend/accesscontrol/ 
total 4 
-rwx------ 1 mado mado 180 2011-10-04 07:55 1* 

Now I have make a rebuild of the RPM-Package without the init script and there are the same problems. After rebooting the system all settings are lost. I hoe these informations ars usefull for you. Thanks in advance

RE: Tvheadend 2.12 - Settings can not be stored? - Added by Hein Rigolo about 13 years ago

daemon tvheadend -u tvheadend -f -C 

There is your problem ....

the -C option removes the configuration and bypasses the security settings.

have a look at the debian init script:
http://www.lonelycoder.com/redmine/projects/tvheadend/repository/revisions/master/entry/debian/tvheadend.tvheadend.init

There tvheadend is started with these arguments:
-f -u hts -g video

-f makes sure tvheadend forks and start it as a deamon.
-u sets the user the hts, meaning that settings are stored at /home/hts/.hts
-g sets the group to video so that tvheadend has access to the video devices.

RE: Tvheadend 2.12 - Settings can not be stored? - Added by Super Grover about 13 years ago

Thanks for your detailed feedback :-)

I try to start tvheadend with the arguments taken from the debian init script

daemon tvheadend -f -u hts -g video

At first I rebuild the Package, start the daemon manually, open my web browser http://localhost:9981 and now I have no login data

A username and password are being requested by http://localhost:9981. The site says: "tvheadend" 
User name:
Password:

This was the reason why I try the option -C. Is there anywhere a hidden file with the login date or how can I access the webui as user?
Thanks in advance.

RE: Tvheadend 2.12 - Settings can not be stored? - Added by Hein Rigolo about 13 years ago

straight from the FAQ:

Help! I can’t login to the web user interface.

If you build Tvheadend from source and just execute it, it won’t let anyone in. The rationale behind this is that I (Andreas) think it is bad to have services running with wide open administrative access.

If you start Tvheadend with the ‘-C’ argument. A default user with no user-name or password will be created. Make sure that you later edit this via the Configuration / Access control tab in the web ui.

If you installed the Tvheadend debian package you should have been asked for a superuser username + password during the install. This super user account can not be modified from within Tvheadend itself. If you want to change it, you need to reconfigure the Debian package. To do that, execute the following line in a command prompt:

sudo dpkg-reconfigure hts-tvheadend

So ... start with -C first .. then remove it. Or checkout what the debian package is doing

http://www.lonelycoder.com/redmine/projects/tvheadend/repository/revisions/master/entry/debian/tvheadend.postinst

(basically it creates the .hts/tvheadend/superuser file with a username and password that you can use to login.)

RE: Tvheadend 2.12 - Settings can not be stored? - Added by Super Grover about 13 years ago

Thank you very much for your helpfull hints and for your support. I will try to implement the debian into mandriva steps :-)

    (1-6/6)