Autor Thema: Autostart tvheadend  (Gelesen 30814 mal)

erdah

  • Newbie
  • *
  • Beiträge: 14
    • Profil anzeigen
Autostart tvheadend
« am: September 16, 2009, 05:40:38 Nachmittag »
I'm using Tvheadend as streaming server. How to make sure Tvheadend starts after the driver is loaded?

Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re:Autostart tvheadend
« Antwort #1 am: September 16, 2009, 05:47:33 Nachmittag »
you can autostart tvheadend by adding a corresponding entry to /etc/rc.local or to add an initscript to /etc/init.d/

rc.local is probably the easier way to do this.
Failure is a good thing! I'll fix it

erdah

  • Newbie
  • *
  • Beiträge: 14
    • Profil anzeigen
Re:Autostart tvheadend
« Antwort #2 am: September 16, 2009, 09:52:06 Nachmittag »
Tvheadend is already starting automatically by initscript. The problem is that it starts before the driver is loaded. Because of that I have to manually restart Tvheadend after each reboot.

Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re:Autostart tvheadend
« Antwort #3 am: September 17, 2009, 01:36:07 Vormittag »
edit the tvheadend initscript

(this is just the example of the mediasrv script)
#! /bin/sh
### BEGIN INIT INFO
# Provides:          mediasrv
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Should-Start:      $syslog
# Should-Stop:       $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      1
# Short-Description: mediasrv startup script
# Description:       this file initially starts the Sundtek Multimedia Framework
### END INIT INFO

add mediasrv to Required-Start: section of tvheadend

### BEGIN INIT INFO
# Provides:          tvheadend
# Required-Start:    $local_fs $remote_fs mediasrv
...

afterwards run:

update-rc.d tvheadend defaults

this should update the order when tvheadend will be started in /etc/rc[n].d/*

Scripts start with S[n]scriptname and are linked to /etc/init.d/scriptname, n indicates the index in which order the scripts sould be started. You might have to adjust this manually but this reply should give you a hint how to solve your request.

you might need to replace "tvheadend" with the name of your local tvheadend initscript.
« Letzte Änderung: September 17, 2009, 06:16:46 Nachmittag von Sundtek »
Failure is a good thing! I'll fix it

erdah

  • Newbie
  • *
  • Beiträge: 14
    • Profil anzeigen
Re:Autostart tvheadend
« Antwort #4 am: September 20, 2009, 07:35:50 Nachmittag »
Excellent, thanks!

rasmus1701

  • Newbie
  • *
  • Beiträge: 2
    • Profil anzeigen
Re:Autostart tvheadend
« Antwort #5 am: April 07, 2012, 10:36:47 Nachmittag »
Sorry to wake up an old thread but this problem (tvheadend starting before the usb tuner driver) can no longer be solved this way since the mediasrv init script is no longer deployed. How is mediasrv started now, and how to make sure it launches before tvheadend?

Sundtek

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 8604
    • Profil anzeigen
Re:Autostart tvheadend
« Antwort #6 am: April 07, 2012, 11:00:46 Nachmittag »
just create 2 files:

Zitat
/usr/bin/tvheadend_restart.sh
#!/bin/bash
/etc/init.d/tvheadend restart

don't forget to chmod 777 /usr/bin/tvheadend_restart.sh

Zitat
/etc/sundtek.conf
device_attach=/usr/bin/tvheadend_restart.sh

that will automatically restart tvheadend when you plug in the USB Stick
Failure is a good thing! I'll fix it

rasmus1701

  • Newbie
  • *
  • Beiträge: 2
    • Profil anzeigen
Re:Autostart tvheadend
« Antwort #7 am: April 10, 2012, 11:49:24 Vormittag »
Thanks - that worked, even for bootup (my USB stick is always plugged in).

tiburcillo

  • Newbie
  • *
  • Beiträge: 3
    • Profil anzeigen
Re:Autostart tvheadend
« Antwort #8 am: Mai 30, 2012, 01:30:53 Nachmittag »
Thanks, this worked for me too!