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.