View Full Version : Confirm rc.sysinit.author Processing
Knocka
03-15-2007, 06:38 AM
I cannot get TivoWebPlus to run at startup and I think that I have a problem with my rc.sysinit.author file. Does this look correct? I have TWP version 2.0 installed in the TivoWebPlus directory in the root folder. The other problem is that although I have edited the tivoweb.cfg file to use port 8888, whenever I start tivoweb (from a telnet session), it does not use that port. I noticed there is a second tivoewb.cfg file in the var/hack/TWP folder. Is that the one I have to edit.
Here is my author file. Thanks for the help.
Knocka.
#!/bin/bash
export PATH=./:.:/utils:/bin:/sbin:/tvbin:/tivobin:/busybox:/enhancements:/enhancements
export TIVO_ROOT=
export MFS_DEVICE=/dev/hda10
#start telnet
tnlited 23 /bin/bash -login &
# start ftp
tivoftpd
fakecall.tcl
route add -host 204.176.49.2 gw 127.0.0.1
route add -net 204.176.49.0 gw 127.0.0.1 netmask 255.255.255.0
/bin/bash </dev/ttyS2&> /dev/ttyS2&
echo
if [ -e /firstboot_flag ]; then
mount -o remount,rw /
if rm -rf /firstboot_flag; then
tivosh /hacks/network.tcl 192.168.15.123 192.168.15.1
mount -o remount,ro /
reboot
#############################################
# starting EndPadPlus
tivosh /enhancements/endpadplus.tcl 1 1 -seq -auto >> /dev/null &
#############################################
# starting Tivowebplus
export TWP_DATA_DIR=/var/TWP
/TivoWebPlus/tivoweb
#############################################
# start crond after waiting 30 seconds
sleep 30
/busybox/crond
#############################################
# Check if var got wiped, and if so, rebuild symlinks from /enhancements/varhacks
if [ ! -e /var/vardelete_flag ]; then
sh /enhancements/var-symlinks.sh
sh /hacks/displaynet.sh | /enhancements/varhacks/hack/bin/out2osd
fi
JWThiers
03-15-2007, 10:01 AM
move the fi to above the
#############################################
# starting EndPadPlus
tivosh /enhancements/endpadplus.tcl 1 1 -seq -auto >> /dev/null &
So it should be
fi
#############################################
# starting EndPadPlus
tivosh /enhancements/endpadplus.tcl 1 1 -seq -auto >> /dev/null &
and no fi at the bottom. Then manually reboot.
BTUx9
03-15-2007, 10:16 AM
umm... how about TWO lines with "fi" there, and move the one at the bottom up a line
#!/bin/bash
export PATH=./:.:/utils:/bin:/sbin:/tvbin:/tivobin:/busybox:/enhancements:/enhancements
export TIVO_ROOT=
export MFS_DEVICE=/dev/hda10
#start telnet
tnlited 23 /bin/bash -login &
# start ftp
tivoftpd
fakecall.tcl
route add -host 204.176.49.2 gw 127.0.0.1
route add -net 204.176.49.0 gw 127.0.0.1 netmask 255.255.255.0
/bin/bash </dev/ttyS2&> /dev/ttyS2&
echo
if [ -e /firstboot_flag ]; then
mount -o remount,rw /
if rm -rf /firstboot_flag; then
tivosh /hacks/network.tcl 192.168.15.123 192.168.15.1
mount -o remount,ro /
reboot
fi
fi
#############################################
# starting EndPadPlus
tivosh /enhancements/endpadplus.tcl 1 1 -seq -auto >> /dev/null &
#############################################
# starting Tivowebplus
export TWP_DATA_DIR=/var/TWP
/TivoWebPlus/tivoweb
#############################################
# start crond after waiting 30 seconds
sleep 30
/busybox/crond
#############################################
# Check if var got wiped, and if so, rebuild symlinks from /enhancements/varhacks
if [ ! -e /var/vardelete_flag ]; then
sh /enhancements/var-symlinks.sh
fi
sh /hacks/displaynet.sh | /enhancements/varhacks/hack/bin/out2osd
re: TWP2, it depends on how it was installed, what release you're running, whether you are running root r/w, and if TWP_DATA_DIR is set (looks like no)
if config and backups directories in /TivoWebPlus are symlinks, the config files in /config are the ones you want to edit
I'd strongly suggest running it from a bash prompt until you get it working the way you want
JWThiers
03-15-2007, 10:37 AM
fi
fi
right.
Fi fi? I knew a girl named Fi fi once.
JWThiers
03-15-2007, 11:05 AM
As long as we are talking about this, I have always had a problem getting a handle on that embedded If section of the author.
if [ -e /firstboot_flag ]; then
mount -o remount,rw /
if rm -rf /firstboot_flag; then
tivosh /hacks/network.tcl 192.168.15.123 192.168.15.1
mount -o remount,ro /
reboot
fi
fi
I think the intent is to on the first reboot after zippering to mount rw, delete the firstboot_flag file, set the network up to what you wanted in the zipper, mount ro, and reboot. thats where the extra reboot after zippering comes from. That section of code only gets run that first time because it deletes the firstboot_flag file
I understand the first if
if [ -e /firstboot_flag ]; then
mount -o remount,rw /
is if a filed called /firstboot_flag exists then mount the partion read write, but the second if stumps me.
if rm -rf /firstboot_flag; then
tivosh /hacks/network.tcl 192.168.15.123 192.168.15.1
mount -o remount,ro /
reboot
fi
fi
To me it looks like an if with no conditions then delete the file /firstboot_flag. If that means (theres that word if again) if the first if is true then ..., why not just leave it out and do it like this.
if [ -e /firstboot_flag ]; then
mount -o remount,rw /
rm -rf /firstboot_flag
tivosh /hacks/network.tcl 192.168.15.123 192.168.15.1
mount -o remount,ro /
reboot
fi
BTUx9
03-15-2007, 11:20 AM
your code should work equally well
other questions about that code:
1) why use the rm -rf on a file (-r is only useful on directories)
2) why not put the file in /var, so it doesn't have to mess with root (yes, there's a VERY slight var will be clobbered)
3) why not modify the script to only run if the entries in mfs aren't already set... that way rezippering wouldn't reset networking that may have been changed
JWThiers
03-15-2007, 11:33 AM
your code should work equally well
other questions about that code:
1) why use the rm -rf on a file (-r is only useful on directories)
2) why not put the file in /var, so it doesn't have to mess with root (yes, there's a VERY slight var will be clobbered)
3) why not modify the script to only run if the entries in mfs aren't already set... that way rezippering wouldn't reset networking that may have been changed
I guess I am learning. I suppose Russ also could have the script modify the author file before the reboot and delete that section and leave the remainder intact. That would also help with #3. But he did do a good job so I won't complain, I just don't understand the syntax on that so I don't see how it gets run.
BTUx9
03-15-2007, 11:43 AM
it's a nested if... the inside only gets run if the file is successfully removed... I don't know what'd cause the file NOT to be removed (other than the drive remount failing, there are a couple esoteric issues that COULD cause it, but I don't imagine they'd crop up on a tivo)
JWThiers
03-15-2007, 12:09 PM
I just have never thought of rm having a true/false value like that. Whatever works is good i suppose. After you are up and running you could do like I did and just delete that part. It doesn't need to run again anyway.
Knocka
03-15-2007, 06:59 PM
re: TWP2, it depends on how it was installed, what release you're running, whether you are running root r/w, and if TWP_DATA_DIR is set (looks like no)
if config and backups directories in /TivoWebPlus are symlinks, the config files in /config are the ones you want to edit
I'd strongly suggest running it from a bash prompt until you get it working the way you want
I have been running TWP it from a bash prompt, but I cannot get it to use port 8888.
I installed it in TivoWebPlus in the root folder. I am not running r/w. I have edited the tivoweb.cfg that I found in /TivoWebPlus/config to use port 8888, but whenever I start tivoweb (from a telnet session), it refuses to use that port. I noticed there is a second tivoweb.cfg file in the var/hack/TWP folder.
Is that the one I have to edit to use Port 8888?
Also, I have the following lines in my author file:
# starting Tivowebplus
export TWP_DATA_DIR=/var/TWP
/TivoWebPlus/tivoweb
Doesn't this set TWP_DATA_DIR? And since I see that there is a var/hack/TWP folder, I guess I assumed it set it correctly. Am I wrong?
Thanks for the help.
Knocka
BTUx9
03-15-2007, 07:11 PM
are you sure there is no /var/TWP folder?
did you check the log?
Knocka
03-15-2007, 08:49 PM
I do have a var/TWP folder, which is why I was under the impression that I had set the TWP_DATA_DIR correctly.
I also checked the log file, and TWP is starting when I run it from a bash prompt. But, it is running on port 80. Should I edit the tivoweb.cfg file that is int he /var/TWP/config folder?
Thanks.
BTUx9
03-15-2007, 08:51 PM
yes, /var/TWP/config contains the config files that should actually be used and modified
you said /var/hack/TWP, which is what confused me.
Knocka
03-16-2007, 05:54 AM
My reference to /var/hack/TWP was erroneous. Sorry about that.
Modifying the /var/TWP/config/tivoweb.cfg file worked. As did the suggestions regarding the author file. It now runs at startup on the correct port.
Thanks to everyone for all their help.
I am still unable to get the IP address to show onscreen during bootup, but that is a minor issue.
And now, against my better judgment (and because I just can't seem to leave well enough alone) I would like to convert the DTV to DHCP. I can assign it a reserved IP address in my router. Anyone know how to do this easily (and reversibly)?
Thanks.
Knocka
vBulletin® v3.6.8, Copyright ©2000-2010, Jelsoft Enterprises Ltd.