PDA

View Full Version : CROND at power up of tivo.


flagmaster
01-01-2008, 09:59 PM
I can get my cron tabs to work just perfect and right on time just like I want them too. But what I cant seem to do is them crond to start up at a power up of the tivo.

I inserted the crond command into rc.sysinit.author, and after it powers up, everytning seems fine. I can even do a PS and it shows up. But it wont work.

The only way I can make it work is to telnet in, type CROND at a shell, then life is good.

Any ideas how I can make this automatic at power up?

labbie48
01-01-2008, 10:15 PM
Read this thread by AlphaWolf, it'll tell you everything you need to know.

http://www.dealdatabase.com/forum/showthread.php?p=189482&highlight=crond#post189482

flagmaster
01-01-2008, 10:22 PM
Actually, yes, that works perfect for me---expect after a reboot or full power off and back on of the tivo. IF that happens (like in a power failure) then the crond wont pick back up the contabs unless I manually telnet in and fire off crond by hand again.

Im unsure as to why this is... if I do a ps I get this after a reboot...

198 root 3924 S ApgSmartSorter
199 root 7836 S ContextMgr eve
200 root 1236 S /bin/bash -login
203 root 768 S /tivo-bin/crond
209 root 736 R ps

You can see the crond task is running, but it wont function till I zap it and start it over by hand....

This must have something to do with the fact that when I telnet in, Im going in as ROOT, but when the system reoboots, and fires off crond task from sys.init its not the root user doing it, its the system itself doing it. How can I fix this?

very confused.

flagmaster
01-02-2008, 10:53 AM
New info...

If I run the crond command via serial bash, it fails to pick up any tasks to do, but if I run it via telnet in, then it works every time. Any clue as to why this might be?

Jamie
01-02-2008, 11:02 AM
New info...

If I run the crond command via serial bash, it fails to pick up any tasks to do, but if I run it via telnet in, then it works every time. Any clue as to why this might be?These things are usually due to differences in your environment. Dump the environment from each context and diff them. For example, In a serial bash session: env | sort > /tmp/serial.txt. Do the similar thing in a telnet session and diff the outputs to see what is different.

flagmaster
01-02-2008, 11:40 AM
nevermind, thats not true, even via serial bash, it works fine, but I have to invoke it at the keyboard. If its invoked in the startup script, then forget it, it wont do anything other then run---and has no workable function.

flagmaster
01-02-2008, 11:51 AM
Thanks Jamie,

The only diff between the serial bash and the telnet bash is the PATH has and extra : in it....

serial bash:
echo $PATH
/sbin:/bin:/hack:/hack/bin::/tivo-bin


telnet bash:
echo $PATH
/sbin:/bin:/hack:/hack/bin:/tivo-bin

I think the extra : in the serial one is due to a typo in my rc.sysinit.
The correct one gets set in my .profile

Jamie
01-02-2008, 12:03 PM
If it works in serial bash, but not in the startup script, dump the startup script env and compare it to the others.

flagmaster
01-02-2008, 12:12 PM
how do I dump the startup script env?
I will try to use the same command and dump it to a file in temp and then look at that file...

(did I just answer my own question? we'll know in a moment!)

flagmaster
01-02-2008, 12:34 PM
Jamie,

You solved my entire problem in a very indirect sort of way. Turns out the whole problem was the result of a bad path.

When I tried your trick, I got the error message the ENV was not found. When I figured out that the ENV command comes from a symlink in TIVO-BIN, then I knew the path must not have been set yet in the startup enviroment.

By moving my export PATH command in front of the crond call in sysinit.author now its working as it should.

Thanks much.

Carey

Jamie
01-02-2008, 01:00 PM
Jamie,

You solved my entire problem in a very indirect sort of way. Turns out the whole problem was the result of a bad path.

When I tried your trick, I got the error message the ENV was not found. When I figured out that the ENV command comes from a symlink in TIVO-BIN, then I knew the path must not have been set yet in the startup enviroment.

By moving my export PATH command in front of the crond call in sysinit.author now its working as it should.

Thanks much.

CareyYep, I figured it was something like that. In general, you want to set and export all the environment variables before you run any other external commands.