/etc/init.d/mythtv-backend fails if /proc/sys/dev/rtc/max-user-freq does not exist
With newer kernels the HPET (High Precision Event Timer) replaces the RTC. The RTC emulation by HPET does not seem to create a link between /proc/sys/dev/rtc/max-user-freq and /proc/sys/dev/hpet/max-user-freq so that seamless change is possible. The following code change to /etc/init.d/mythtv-backend adds a test to see if either RTC or HPET exist, and only tried to update max-user-freq if it does. If may be worth printing an error message to the log if it does not.
==============================================================
case "$1" in
start)
if test -e RUNDIR/
NAME.pid ; then
echo "mythbackend already running, use restart instead."
else
# set the timeslice to 1/1024 of a sec for smoother mythtv and xine and mplayer playback
if [ -w /proc/sys/dev/rtc/max-user-freq ] # check if RTC (older kernels) exists and I can write to it
# failure is not an option!
then
echo 1024 > /proc/sys/dev/rtc/max-user-freq
elif [ -w /proc/sys/dev/hpet/max-user-freq ] # or newer kernels with the High Precision Timer (HPET)
# may or may not emulate the older RTC fully
then
echo 1024 > /proc/sys/dev/hpet/max-user-freq
fi
# start starting the startup of mythtv
echo -n "Starting $DESC: $NAME "
start-stop-daemon --start --pidfile RUNDIR/
NAME.pid
--chuid $USER --nicelevel $NICE --exec $DAEMON -- $ARGS
echo "."
fi
;;