Restart Humax software without a reboot

prpr

Well-Known Member
This has been bugging me for ages, and finally I seem to have found out how to do it.
Code:
#!/bin/sh
echo Stopping mod daemons
dir=/mod/etc/init.d
for f in `ls -r1 $dir/S*` ; do
  if [ -x $f ]; then
    echo "  $f stop"
    $f stop
  fi
done
echo Stopping Humax app.
/etc/init.d/S90settop shut
echo Removing cached EPG data
if [ "`cat /etc/model`" = "HD" ]; then
  epg=/media/drive1/epgsavedata
else
  epg=/mnt/hd1/dvbepg/epg.dat
fi
[ -f $epg ] && rm $epg
echo Killing DHCP daemon
killall udhcpc
for f in `mount|grep ^/dev/sd|sed -r 's/(.*) on .*/\1/g'` ; do
  echo Unmounting $f
  umount -l $f
done
cat /proc/mounts | grep -q /etc/opkg && umount /etc/opkg
for f in /sys/block/sd? ; do
  echo Stopping $f
  echo 1 >$f/device/delete
done
echo Restarting xinit modules
/etc/init.d/S80xinit start
echo Restarting Humax app.
/etc/init.d/S90settop resume
I copied this script to /tmp before running it.
Everything appears to work. The TSR buffer and normal recordings definitely do.
The picture outage time is about 12 seconds and overall the process takes about 20 (but is obviously dependant on which packages are installed). It is a lot quicker than a reboot.
 
Last edited:
However, in my experience if you start the Humax software from the command line then several things don't work properly, such as DLNA.
Mind you, I never got TSR working after a restart so you are ahead of my efforts!
 
Well, I've just decrypted a test recording apparently using the DLNA server.
I've added in "/etc/init.d/S80xinit" as well so it should process rsvp.db and stuff like tunefix. Testing continues!

Like I said somewhere else (which I can't find), how does the Humax app. know whether it's being started for the first time or not?
The key to it seems to be stopping the disk...
 
Last edited:
I added an entry to the recording schedule using the Webif and ran the script. The entry was put into the live schedule and the programme was recorded and decrypted fine. I've also tested DLNA from the HDR and that's fine too.
 
Very nice find. I can't test this myself since I'm travelling but if you have the IR package installed, does the heap location change (should be logged in humaxtv.log)?
 
Here's the first part of the diff:
Code:
 IR3 debug: 1
 IR3 Mode: 2 (0x10fa)
 IR3 Options: 0x2
-Open addr: 0x10184b0
-Scanning heap from 0x100adc0
-0100adc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100add0: 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00  ................
-0100ade0: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100adf0: 00 00 00 00 00 00 00 00 c0 ad 00 01 02 00 00 00  ................
-0100ae00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae30: 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00  ............ ...
-0100ae40: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  @...............
-0100ae50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae90: 00 00 00 00 00 00 00 00 00 00 00 00 48 af 00 01  ............H...
-0100aea0: 50 b2 00 01 00 00 00 00 01 00 00 00 48 af 00 01  P...........H...
-0100aeb0: 3c b2 00 01 00 00 00 00 00 00 00 00 00 00 00 00  <...............
-0100aec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100aed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100aee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100aef0: 00 00 00 00 00 00 00 00  ........
+Open addr: 0x1018278
+Scanning heap from 0x100ab88
+0100ab88: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ab98: 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00  ................
+0100aba8: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100abb8: 00 00 00 00 00 00 00 00 88 ab 00 01 02 00 00 00  ................
+0100abc8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100abd8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100abe8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100abf8: 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00  ............ ...
+0100ac08: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  @...............
+0100ac18: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac28: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac38: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac48: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac58: 00 00 00 00 00 00 00 00 00 00 00 00 10 ad 00 01  ................
+0100ac68: 18 b0 00 01 00 00 00 00 01 00 00 00 10 ad 00 01  ................
+0100ac78: 04 b0 00 01 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac88: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac98: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100aca8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100acb8: 00 00 00 00 00 00 00 00  ........
 Found at +00000000
-getplns() = 0x100adc0 (@00000000)
-0100adc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100add0: 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00  ................
-0100ade0: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100adf0: 00 00 00 00 00 00 00 00 c0 ad 00 01 02 00 00 00  ................
-0100ae00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae30: 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00  ............ ...
-0100ae40: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  @...............
-0100ae50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100ae90: 00 00 00 00 00 00 00 00 00 00 00 00 48 af 00 01  ............H...
-0100aea0: 50 b2 00 01 00 00 00 00 01 00 00 00 48 af 00 01  P...........H...
-0100aeb0: 3c b2 00 01 00 00 00 00 00 00 00 00 00 00 00 00  <...............
-0100aec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100aed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100aee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
-0100aef0: 00 00 00 00 00 00 00 00  ........
-NEXUS_IrInput_Open(00000000, 7fd5bad0, 2aab205c, 7fd5baec) = 010184b0
-Sat Jan  1 00:00:11 2000 Applying minimum fan speed = 127 (7f)
+getplns() = 0x100ab88 (@00000000)
+0100ab88: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ab98: 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00  ................
+0100aba8: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100abb8: 00 00 00 00 00 00 00 00 88 ab 00 01 02 00 00 00  ................
+0100abc8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100abd8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100abe8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100abf8: 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00  ............ ...
+0100ac08: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  @...............
+0100ac18: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac28: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac38: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac48: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac58: 00 00 00 00 00 00 00 00 00 00 00 00 10 ad 00 01  ................
+0100ac68: 18 b0 00 01 00 00 00 00 01 00 00 00 10 ad 00 01  ................
+0100ac78: 04 b0 00 01 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac88: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100ac98: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100aca8: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+0100acb8: 00 00 00 00 00 00 00 00  ........
+NEXUS_IrInput_Open(00000000, 7f91cad0, 2aab205c, 7f91caec) = 01018278
 irthread starting.
 Message queue open.
+Mon Feb 29 10:48:28 2016 Applying minimum fan speed = 127 (7f)
 -------------------------------------
 Initialising Dustbin v1.0
 Dustbin debug: 0
 Dustbin media root: /mnt/hd2/My Video/
 Dustbin path: /mnt/hd2/My Video/[Deleted Items]
 -------------------------------------
+ln: /media/My Video: File exists
 udhcpc (v1.20.2) started
+ln: /media/My Music: File exists
+ln: /media/My Photo: File exists
 udhcpc deconfig  eth0  0.0.0.0
 
Does this method work in the circumstances where a full reboot sometimes fails (box woken by timer event rather than started via remote)?
 
Sadly, but not unexpectedly, it does go back to sleep when it had been woken by timer event.
Can wherever this flag is stored be written to, or is that beyond our ability?
 
How does /tmp/.lbr get written?

This thread was about reboots ending up in standy, but fizzled out. Perhaps better to carry on this aspect of it there rather than here?
 
How does /tmp/.lbr get written?
Missed this, sorry.
It's created by the ahw utility during boot - /usr/bin/ahw on CFW 3.10 or /mod/boot/xinit.d/ahw otherwise.
It chats to the front panel and retrieves the time which it uses to set the system clock and also a byte which reflects the last boot reason.
 
I found I needed to add this to stop duplicate mounts accumulating when the opkg-beta package is installed:
Code:
cat /proc/mounts | grep -q /etc/opkg && umount /etc/opkg
 
Like this?
Code:
#!/bin/sh
</proc/mounts grep -q /etc/opkg || 
    mount --bind \
          /var/lib/humaxtv_backup/mod/opkg \
          /etc/opkg
Still to do ...
 
I had it lined up in my local working copy, for some reason never published. I've just done it, thanks for the nudge!
 
  • Like
Reactions: /df
In what form does this hit the streets - a Diagnostics >> Restart button in addition to the Diagnostics >> Reboot Button?
 
I was referring to the extra check for an existing mount of the opkg-beta repo, and I expect that is what is to be published.

I suspect that the restart script needs a lot more testing before it could be let loose, but would like to be proved wrong.
 
Back
Top