Feature #2651
Please consider adding "Start TVHeadEnd at system startup" and "Restart TVHeadEnd automatically if it crashes" checkboxes to the General tab on the web interface
0%
Description
Or it could be on some other tab, it really doesn't matter.
The reason for asking for the "Start TVHeadEnd at system startup" checkbox is that with some satellite tuner cards, notably those from TBS, you need to recompile and reinstall the drivers after each Linux kernel update. But the proper procedure is to install the kernel update, reboot, then recompile and reinstall the tuner card drivers, then reboot again.
The problem is that if TVHeadEnd comes up after the first reboot, before the tuner drivers are reinstalled, and finds those tuners missing, it may start removing parts of the configuration associated with those tuners - anything from channels received via those tuners to the entire tuner configuration. Since I don't know exactly what can happen, I feel a lot more comfortable if I can disable TVHeadEnd so it will not automatically come up while the drivers are not recognized or not working properly.
I attempted to stop TVHeadEnd in Webmin the last time there was a kernel update and the unfortunate side effect of that was that it screwed up whatever watches TVHeadEnd and restarts it if it crashes. That incident is related in more dedtail in this post: http://tvheadend.org/boards/5/topics/15142 So, the reason for asking for the "Restart TVHeadEnd automatically if it crashes" checkbox is so that if for some reason the "watcher" process stops working, I can uncheck the box and save the configuration, then recheck the box and save the configuration again and it should restore it. Basically I'm just wanting a way to re-enable the watcher process if it somehow becomes disabled. But there may be other reasons someone might not want TVHeadEnd to restart automatically if it crashes, for example if they are testing something and need time to fix a problem after a crash, before restarting TVHeadEnd.
As you can see if you have read my post, trying to use Webmin for the purpose of stopping TVHeadEnd and preventing it from starting automatically at the next boot seems to be asking for trouble - so far, I never have been able to figure out how to get the "watcher" process going again. I do realize that if I disable automatic startup at boot, I will have to manually start TVHeadEnd from a command prompt so that I can get to get to the web interface, in order to recheck the box to re-enable starting TVHeadEnd at bootup. So, it might be prudent to include a short note explaining how to do that (or a link to a wiki page that explains it) somewhere adjacent to the checkbox.
History
Updated by Mark Clarkstone almost 10 years ago
K Shea wrote:
Or it could be on some other tab, it really doesn't matter.
The reason for asking for the "Start TVHeadEnd at system startup" checkbox is that with some satellite tuner cards, notably those from TBS, you need to recompile and reinstall the drivers after each Linux kernel update. But the proper procedure is to install the kernel update, reboot, then recompile and reinstall the tuner card drivers, then reboot again.
The problem is that if TVHeadEnd comes up after the first reboot, before the tuner drivers are reinstalled, and finds those tuners missing, it may start removing parts of the configuration associated with those tuners - anything from channels received via those tuners to the entire tuner configuration. Since I don't know exactly what can happen, I feel a lot more comfortable if I can disable TVHeadEnd so it will not automatically come up while the drivers are not recognized or not working properly.
I attempted to stop TVHeadEnd in Webmin the last time there was a kernel update and the unfortunate side effect of that was that it screwed up whatever watches TVHeadEnd and restarts it if it crashes. That incident is related in more dedtail in this post: http://tvheadend.org/boards/5/topics/15142 So, the reason for asking for the "Restart TVHeadEnd automatically if it crashes" checkbox is so that if for some reason the "watcher" process stops working, I can uncheck the box and save the configuration, then recheck the box and save the configuration again and it should restore it. Basically I'm just wanting a way to re-enable the watcher process if it somehow becomes disabled. But there may be other reasons someone might not want TVHeadEnd to restart automatically if it crashes, for example if they are testing something and need time to fix a problem after a crash, before restarting TVHeadEnd.
As you can see if you have read my post, trying to use Webmin for the purpose of stopping TVHeadEnd and preventing it from starting automatically at the next boot seems to be asking for trouble - so far, I never have been able to figure out how to get the "watcher" process going again. I do realize that if I disable automatic startup at boot, I will have to manually start TVHeadEnd from a command prompt so that I can get to get to the web interface, in order to recheck the box to re-enable starting TVHeadEnd at bootup. So, it might be prudent to include a short note explaining how to do that (or a link to a wiki page that explains it) somewhere adjacent to the checkbox.
I believe tvheadend doesn't remove anything if I tuner becomes unavailable. The only issue I've had is when the adapters change adapter position then I have to reconfigure the adapter (it sounds like this is your problem, have you set adapter_nr?).
When I used my TBS tuner I manually rebuilt the driver after updating the system once a week, no automatic updates. One of the reasons why I stopped using TBS devices that, and the fact the drivers are stupidly outdated and buggy!
This watcher must be something to do with webmin as when mine crashes I have to manually restart it, that hasn't happened for a while now though, it sounds like you've got a bug if yours keeps crashing.
Updated by just bkifft almost 10 years ago
Start on boot and restart on crash are in the domain of the OS (to be more precise it's service management) and should not be handled by the service on it's own.
I haven't touched Debian in ages so I have no idea which of the bazilion init systems (the logic that loads everything on boot) it uses, should be upstart or systemd though.
You might want to look into "ssh" (remote prompt/console/shell) and your init system (just try the commands "systemctl" (systemd) and "initctl" (upstart) to figure out which one you got).
That being said: I've never had tvheadend delete anything without me telling it explicitly to do so.
Updated by K Shea almost 10 years ago
just bkifft, I do have ssh installed and I tried both of the commands you mentioned, both without and with sudo, and in all cases it returned "command not found". This is just a straight install of Debian Wheezy; I'm not familiar enough with Linux to do anything special (one reason I use Webmin is that it simplifies many Linux tasks). I have never had a problem with using Webmin to stop or start a running task, or to temporarily stop it from running at boot, until TVHeadEnd.
With regard to the watcher, there is no way that is part of Webmin. If I recall correctly, it used to be if you got a list of running processes, there were two processes, tvheadend and hts. Now if I do ps -ax I see:
9114 ? Ssl 118:13 /usr/bin/tvheadend -f -u hts -g video
But I do not see a process called hts which I thought was the "watcher" that restarted TVHeadEnd if it crashed. I know hts is also the name of the default TVHeadEnd user, but this was a process called hts. But perhaps I am not remembering this correctly.
TVHeadEnd does not crash that often on me normally, but for some reason the version I am running now (HTS Tvheadend 3.9.2331~gb85ec59~wheezy) has a nasty habit of crashing if I try to tune to a channel that is "off the air" or otherwise unavailable. I suspect this is an issue in the DVB-S2 tuning section of the software (though that is just a wild guess because I don't know enough about Linux to actually pinpoint the issue) and for all I know the problem may go away next time I upgrade TVHeadEnd, but I don't like to do that very often because I'm always afraid I might get a version that has some real issues or that otherwise won't work as well as the version I am using, and I would have no way to drop back a version.
And, I've definitely had some issues with TVHeadEnd deleting channels (or more correctly, removing the link to the tuners that should be used to receive them, and reporting "Missing in PAT/SDT") when no signal is available. But I believe that is a bug that was fixed recently. Still, ever since that happened I've been worried that if it doesn't see any signal it will start removing parts of the configuration.
The thing that I really don't understand is why in Webmin I can tell it to stop TVHeadEnd and not start it at boot and that works, but if I then tell Webmin I wan to start TVHeadEnd and have it start at boot, that doesn't work, yet if I install an update to TVHeadEnd then the start at boot starts working again. That behavior is why I wish there was a checkbox in TVHeadEnd - Webmin is at the very least not undoing whatever it does when it stops TVHeadEnd from starting at boot. Many other programs have a checkbox in their configurations that can be used to indicate whether you want the program to start at boot or not, and it would be useful if TVHeadEnd did.
Updated by Torbjørn Brekke almost 10 years ago
If I remember correctly you can use this to start/stop/restart tvheadend:
service tvheadend stop/start/restart
You might have to use sudo in front. And of course use only one option in the end.
Updated by K Shea almost 10 years ago
Torbjørn Brekke, that will work, but then if I reboot TVHeadEnd will restart at boot. What I really need is a way to temporarily, but not permanently, disable TVHeadEnd from starting at the next reboot.
Updated by Raymond Paulsen almost 10 years ago
Simple bash can utilize a init.d startup script:
#!/bin/sh if ! ps aux |grep -v grep |grep -c /usr/bin/tvheadend >/dev/null then /etc/init.d/tvheadend start echo `date "+%d/%m/%y %R process was not working"` >> /var/log/tvheadend/tvheadend_restart_log else echo "ok" # If tvheadend passes all conditions and all is OK, it will simply echo "ok" :-) fi
Updated by Jaroslav Kysela over 9 years ago
- Status changed from New to Rejected
I don't think that it's task for the application.