Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: editing rc.sysinit to install cron

  1. #1
    Join Date
    Jul 2002
    Posts
    51

    editing rc.sysinit to install cron?

    I added the line
    /hack/bin/cron

    to the end of my rc.sysinit but it doesn't appear to be starting on bootup..

    I can execute
    /hack/bin/cron
    from bash and it will run..

    I've also notice via "ps" that
    /bash /etc/rc.d/rc.sysinit
    appears still to be running? It shows a PID 4 and TTY S3

    anyhow.. I'm still learning unix so any help would be greatly appiciated..

    thanks..

    jfkjfk
    Last edited by jfkjfk; 08-24-2002 at 07:02 AM.

  2. #2
    Join Date
    Jul 2002
    Posts
    51
    Ok I moved the line above
    the last few lines in rc.sysinit which where
    I just figured to try to put it before the "...is complete"

    ---
    echo "rc.sysinit is complete"
    exec < /dev/ttyS3 >& /dev/ttyS3; bash --login
    ---
    and it works.. Anyone care to explain what's going on here??

    thanks..

    jfkjfk

  3. #3
    Join Date
    Aug 2001
    Location
    out of space
    Posts
    1,880
    I noticed that strange things were happening when I added cron to rc.sysinit. I put these 2 lines at the very end after the bash startup and all seems to be ok now.
    sleep 180
    /hack/bin/cron

  4. #4
    Join Date
    Jul 2002
    Posts
    51
    care to embellish on that a little? "strange things"
    what about creating an
    rc.sysinit.author ?
    or do you thinik strange things would happen there to?

    How do I put it at the end of the bash startup?

    thanks.

    jfkjfk

  5. #5
    Join Date
    Aug 2001
    Location
    out of space
    Posts
    1,880
    I suggest you just put those 2 lines as the last 2 in rc.sysinit. The sleep 180 causes a delay of 3 minutes before starting cron. With my setup the delay was necessary because of conflicts with the startup of other processes at the same time.

  6. #6
    Join Date
    Sep 2001
    Posts
    457
    /var/bin/cron &

    That way rc.sysinit can exit completely.

    At least that is how I do it.

  7. #7
    Join Date
    Jul 2002
    Posts
    51
    Originally posted by genericuser
    /var/bin/cron &

    That way rc.sysinit can exit completely.

    At least that is how I do it.
    Interesting.. So do you think that
    these lines
    echo "rc.sysinit is complete"

    exec < /dev/ttyS3 >& /dev/ttyS3; bash --login

    at the end are what cause rc.sysinit to stay running?
    perhaps I need and & after that line?
    This rc.sysinit is from Kraven's xtreme upgrade...

    thanks..

    jfkjfk

  8. #8
    Join Date
    Sep 2001
    Posts
    457
    That is of course why it does not complete. You will not pass that line until you exit bash.

    Here is how I start bash:

    /bin/bash --login < /dev/ttyS3 >& /dev/ttyS3 &

    Same as yours, but different :-)

    Notice it is put into the background so the script can continue...

    Here are the last few lines I use:

    /bin/bash --login < /dev/ttyS3 >& /dev/ttyS3 &
    sleep 200
    /var/hack/cron/cron &

    echo "Ending rc.sysinit"

  9. #9
    Join Date
    Jul 2002
    Posts
    51
    genericuser,
    thanks for the good info... I didn't write the script.. But now I understand it..
    I don't think the & is required for cron because it seems to put itself in the background automatically... Thinking about it I guess I was lucky that it does, or else I would have lost bach all together..
    anyhow...

    thanks

    jfkjfk

  10. #10
    Join Date
    Aug 2001
    Location
    out of space
    Posts
    1,880
    The problem with initializing cron without a delay at startup is that cron can start running your scripts while the TiVo processes are still initializing. This can cause at minimum a long delay in getting to live tv.

  11. #11
    Join Date
    Jul 2002
    Posts
    51
    ok.. I've gone ahead and used genericuser's bash startup line.. Apparently using the exec command will keep the rc.sysinit alive until bash exits.. After reading a bit I'm under the impression that scripts by default spawn new processes to run commands.. exec makes the script wait..
    I don't know why Kraven would run bash like that?
    ANyhow..

    thanks all for the help.. I've learned a lot..

    jfkjfk

  12. #12
    Join Date
    Jan 2002
    Posts
    39
    When you guys installed cron to /hack/bin where did you put crontab? Or more to the point did you guys have to make the /var/hack/cron /var/hack/etc, and /var/hack/etc/cron.d directories? The reason why I ask is because according to the README you have to install it to /var/hack/cron because it is hardcoded to look there for the logs and such. Every time I nstall it in /hack/bin and try run it I get all kinds of errors. I'm not near my tivo or I'd post what they are.

  13. #13
    Join Date
    Sep 2001
    Posts
    457
    Yeah, the pixiecron .zip has a script that creates the directory structure you need. Then you just copy the files into their destinations:

    cron to /var/hack/cron
    crontab to /var/hack/etc

    That should be all you need.

  14. #14
    Join Date
    Jul 2002
    Posts
    51
    Yes.. You have to create the directories yourself, or run script.. Either way..

    I also created a symbolic link to the file, so I can just go to my normal /hack/scripts bin, and adjust any settings I want for cron, or other stuff I run or change....
    cd to directory you want it in..
    add symbolic link
    ln -s /var/hack/etc/crontab crontab
    now you can just edit from that dir...

    jfkjfk

  15. #15
    Join Date
    Jan 2002
    Posts
    39
    but if the /var partition gets wiped and rebuilt by tivo I'll still have to recreate the directories and sym links. That is what I was trying to avoid. I do appreciate the info though.

Posting Permissions

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