Page 1 of 3 123 LastLast
Results 1 to 15 of 32

Thread: last successful call / mfs entries

Hybrid View

  1. #1
    Join Date
    Jun 2001
    Posts
    3,108

    last successful call / mfs entries

    how is everyone figuring out what entries there are in the mfs database? i have changed the NoMoreNagz script to incorporate the changeDialtime script (no big deal really), but i would like to set the 'Last Successful Call' value in the database. I can change the 'Last Call Attempt' and can set the 'Last Call Status', but I would like to tell it that the Last successful call was now as well. here is the changed script that i am working with.

    #!/tvbin/tivosh
    ##############
    # NoMoreNagZ #
    ##############
    #
    # 07-14-01 Last Call Attempt now set
    # Next Call Attempt now set
    source /tvlib/tcl/tv/Inc.itcl
    source /tvlib/tcl/tv/mfslib.tcl
    source /tvlib/tcl/tv/setup.tcl
    source /tvlib/tcl/tv/StatusStrings.itcl

    set serviceState 5
    set now [clock seconds]
    set stateExpiration [expr ($now / 86400) + 365]
    set nextCall [expr ($now) + 364*24*60*60]

    set db [dbopen]
    transaction { set setup [db $db open /Setup]
    dbobj $setup set ServiceState $serviceState
    dbobj $setup set ServiceStateExpiration $stateExpiration
    dbobj $setup set LastCallStatus $StatusStrings::Succeeded
    dbobj $setup set LastCallAttempt $now
    dbobj $setup set NextCallAttempt $nextCall
    }
    dbclose $db

  2. #2
    Join Date
    Jun 2001
    Posts
    3,108
    well, here I go answering my own question. if anyone wants to know, i used 'dumpobj /Setup' to see all the entries. here is the updated script:

    #!/tvbin/tivosh
    ##############
    # NoMoreNagZ #
    ##############
    #
    # 07-14-01 Last Call Attempt now set
    # Next Call Attempt now set
    # Last Successful Call now set
    source /tvlib/tcl/tv/Inc.itcl
    source /tvlib/tcl/tv/mfslib.tcl
    source /tvlib/tcl/tv/setup.tcl
    source /tvlib/tcl/tv/StatusStrings.itcl

    set serviceState 5
    set now [clock seconds]
    set stateExpiration [expr ($now / 86400) + 365]
    set nextCall [expr ($now) + 364*24*60*60]

    set db [dbopen]
    transaction { set setup [db $db open /Setup]
    dbobj $setup set ServiceState $serviceState
    dbobj $setup set ServiceStateExpiration $stateExpiration
    dbobj $setup set LastCallStatus $StatusStrings::Succeeded
    dbobj $setup set LastCallAttempt $now
    dbobj $setup set LastSuccessCall $now
    dbobj $setup set NextCallAttempt $nextCall
    }
    dbclose $db

  3. #3
    Join Date
    Jul 2001
    Location
    Out There...
    Posts
    410

    Angry Still dials daily

    Thanks for NoNoreNagz. Ran the script through tivosh, and my system info screen indicates all the changes, with next call set for next year. But the machine still attempts a call each evening anyway - indicating failure, and a next call a few hours later. I can run the script again, get the info screen to look nice, but the call will still try again.

    I examined the log (tvlog) - and there appears to be a variable "secSinceLast" which keeps incrementing despite the setting lastSuccess to now. My secSinceLast reports over 600000 in the log, and keeps going higher despite nomorenagz.

    Tcphonehome is still invoked daily.

    What if.... I replace the tcphonehome binary with something like "ls" - renamed to tcphonehome - so when invoked, nothing of consequence should happen. Think this will send the machine to the nuthouse?? There's also the tcwatchdog binary which looks interesting as well.

    Note: Using chattr to preserve all changes between boots.

    Oh... and how do I invoke 'dumpobj /Setup' to see the settings? Does this list all available variables and values? From the bash prompt? Or a new script run via tivosh? A Linux newbie here, but learning fast.

    Thanks

  4. #4
    Join Date
    Jun 2001
    Posts
    3,108
    dumpobj works in tivosh, so you would do:

    bash 2.02# tivosh
    %dumpobj /Setup

    i noticed the same problem with the call being attempted every night. im not sure if there is a cron type setup with the tivo, so we could schedule the nomorenagz script to be run once a night. you could try renaming tcphonehome to something else and copying the nomorenagz script into its place.

    i will take a look for that secSinceLast, but thats darn good detective work. dumpobj will dump whatever is in the database you specify. 'dumpobj /Setup' will show you basically the same info that is on the system info screen.

  5. #5
    Join Date
    Jul 2001
    Location
    Out There...
    Posts
    410
    Got the dumpobj list - thanks. Was hoping to see the secSinceLast varible listed - not...

    I also got some occasional reboots while experimenting the last few days. First thought was heat related - but still did it with the cover off. Log doesn't show a reboot issued, but I kinda suspect Tivo is up to something - that's why I'm wondering about tcwatchdog.

    As for secSinceLast, yesterday I had tried just setting it to 300 within the script - no affect - and I didn't expect one. I cannot get the true varible name to load into the db (SecSinceLast? - note cap) - or does tcphonehome calculate this from some unknown variable/clock. I'll be scrolling through the tcphonehome binary for clues - this bin definitely puts secSinceLast in the log, and I have found the string within the binary.

    Too many hobbies... didn't want another.... esp with a crash course in Linux required.

  6. #6
    Join Date
    Jul 2001
    Location
    Out There...
    Posts
    410
    mrblack51...

    By the way... I had noticed tonight that after the failed call (608PM) attempt, it was going to try again a few hours later. By rerunning the script, that next call did not occur - but it will surely will try tomorrow night again.

    Yesterday I had tried the line:

    tivosh /mypath/nonagz.itcl

    within Setup.itcl.

    This did not appear to work. Need to find a boot-time script to insert the command, and perhaps a do/while and wait loop.

  7. #7
    Join Date
    Jun 2001
    Posts
    3,108
    i havent been running nonagz with tivosh. you should be able to do a /mypath/nonagz.itcl or whatever

  8. #8
    Join Date
    Jul 2001
    Posts
    9
    Wow, you guys are close...

    I had no idea that anyone had publicly gone this far with a service hack...

    chipster, the startup script you are looking for is rc.sysint. It is in /etc/rc.d on the active partition. You could call "nomorenagz.itcl" at the end of it, just like with the bash prompt. While you are in there, add a line at the end like this:

    rm -f /var/log/*

    which will clean out your logs every time you boot. Also, find the lines:

    rm -f /var/run/syslogd.pid /var/run/klogd.pid
    syslogd -p /var/dev/log -m 10000
    klogd

    and comment them out by putting a "#" and a space in front of them. This will stop the logging deamons from running in the first place (which saves a few CPU cycles and will also help speed up the system a bit).

    Remember to chattr +i this file when you are done...

    BTW, You are on the right track with the "secSinceLast" thing; also look for ReschedCall and numFails... You will get there...

    Mr. Black, great work on the nomorenags script, but *please* be carefull. TiVo has about 250,000 subs right now and if they do not get a bunch more soon, there will be no more Tivo. Please remember that.

  9. #9
    Join Date
    Jul 2001
    Location
    Out There...
    Posts
    410
    Thanks for the hints InTek... the log hack was next on my list - thanks for that too.

    As for Tivo, they're getting my money as well. The fun is in the hunt - not the kill.

    And you may be right about keeping this at a lower profile...

  10. #10
    Join Date
    Jul 2001
    Posts
    14
    Running this script from the end of /etc/rc.d/rc.sysinit seemed like a good idea at the time but it appears to collide with something else over the use of the setup lock (it may be tcphonehome.tcl which is running at the time). I'll have to do a little digging around in the near future to see how this can be fixed but in the meantime, don't expect this to work from rc.sysinit.
    What's that light I see at the end of the tunnel?

  11. #11
    Join Date
    Jul 2001
    Location
    Out There...
    Posts
    410
    trainboy,

    I've had occasional success running nomorenagz from rc.sysinit. Since my last post, I've put a while / sleep function in a script to repeat nomorenagz every few hours. But I can't get this to work from rc.sysinit.

    this is my script (from memory):

    #!/bin/bash
    # Reset.itcl

    while (true)
    do
    {
    /etc/rc.d/nonagz.itcl
    /bin/sleep 7200
    }
    done

    I can invoke this from the bash prompt as follows:

    /etc/rc.d/Reset.itcl& # & appended for Run in background process

    I can do ps from the tivosh prompt and see the sleep function, and the unit updates every two hours.

    I can't seem to get this to work from rc.sysinit??? Probably just too lame with Linux. I don't see "sleep" listed when I invoke PS from the tivosh prompt.

    What would the command syntax be from rc.sysinit? Does it need to be assigned to a particular console (tty) - as we do to get the bash prompt in the first place??? If so, how?? Tried with and without the trailing "&". Is this a place to use the "exec" command??? How???

    And it still tries to call anyway - I'm still trying out things with secSinceLast, numFails to no avail. Also found a file, /var/persist/CallID which I looks like it contains the time of the last success call. Changed to current time, but secSinceLast still counts up / not reset. Had a reboot yesterday while I was away, and I think this has something to do with numFails or the ReschedCall/Reason - wherever that gets set...

    AArgh.... need a SLEEP command for myself...

  12. #12
    Join Date
    Jul 2001
    Location
    Florida
    Posts
    68
    You can create a .bashrc file that will run when you boot up. That might be a better place for your nonagz routine. Since the root is read only, I have it execute a script in my VAR partition and I can modify it any time I want to add something new without having to remount the root ar read write.

  13. #13
    Join Date
    Jun 2001
    Posts
    3,108
    did you take a look at the LAST-MONTHLY-BACKHAUL file in the /var/persist directory? it also appears to have a date/time in it.

    of course, i didn't really like finding the tivoLog.longterm in the /var/persist directory either. wow, they track you in a number of places.

    i just replaced the times in both with the date/time i used to set my lastCallSuccess. i will let you know if it still works ok. the latest autogenerated message indicated that since it had been 28 days since my last call, i had 3 left.

  14. #14
    Join Date
    Jul 2001
    Location
    Out There...
    Posts
    410
    Hadn't played with last-monthly-backhaul yet, but was on the list.

    Have changed my mind about my reboots. Caught the unit yesterday stuck on "Powering Up". My PC bios wouldn't recognize the drive when I attached it. Placed it in the fridge for an hour, and the PC sees it. Looks like the drive is on its deathbed. Got another lct20 locally - backup finished this AM successfully. I had never seen any indication of Tivo-invoked reboot in the logs.

    During the backup last night, I put in a drive from a different open box DTivo (real cheap from BB - missing everything but box, told them was purchasing for parts - no access card included, but with $100 rebate!). This had older, used 2.0 software on it. Added bash command and my reset/nonagz routines to the drive before mounting it.

    The previous owner had a lifetime on the box - didn't notice any hacks, and it had last called home in March. I quickly got the nag screen and all Tivo functions were disabled (over 30 days). I ran my reset routine (from bash prompt), and all appears well. Have set the sleep time to 1800 (every half-hour). Looking at logs, it still tried to call last night, but all functions still work. numFails is up to 6 - got to figure this one out. Oh.. added:

    set secSinceLast 0

    to nonagz. Log says secSinceLast is 0 - but I don't believe it, maybe just in generating the log entry. Saw this before. If i let a call fail before running nonagz, secSinceLast shows a big number always incrementing. On the bright side, the stored secSinceLast for this drive goes back to March - so the value is stored on the drive somewhere - not in hardware.

    Now to consult the manual on bashrc. What directory does this go in? How often does it invoke? Special syntax dor this file?? I don't want multiple instances of my reset routine running if bashrc is invoked each time bash is run. Pitiful trying to learn Linux on the fly - and ignorant of these basic concepts.

  15. #15
    Join Date
    Jul 2001
    Location
    Florida
    Posts
    68
    If you are getting the bash prompt on the serial port, that is always there and run only one time (as is .bashrc which should be placed in the root "/"). So no worries about mutiple programs running.
    I can't comment on TiVoNet, as I do not have it or expect to get it.
    My .bashrc is very simple:

    #bashstuff / .bashrc 5/14/01
    export PATH=/var/new/devbin:$PATH
    . /var/new/script/alias.tcl

    alias.tcl is a script that creates a bunch of alias's (dir="ls -al")
    but could also run other scripts. I did this so I would not have to repeatedly modify the root which is mounted r/o.

    Some people set the serial port speed
    stty=57600

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •