best method to schedule a script a few minutes after boot? - Slackware

This is a discussion on best method to schedule a script a few minutes after boot? - Slackware ; Hi there, I want to run a script after a small delay from reboot to reload the firewall rules. This is because kernel timers start a bit before zero and the timer rules are not quite right until the kernel ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: best method to schedule a script a few minutes after boot?

  1. best method to schedule a script a few minutes after boot?

    Hi there,

    I want to run a script after a small delay from reboot to reload
    the firewall rules. This is because kernel timers start a bit before
    zero and the timer rules are not quite right until the kernel is into
    'positive time'.

    I suppose I could background a 'sleep nnn' script from rc.local, but
    wondering what alternatives there are?

    Is this something 'at' is good for?

    Other options?

    Thanks,
    Grant.
    --
    http://bugsplatter.id.au

  2. Re: best method to schedule a script a few minutes after boot?

    On 2008-11-02, Grant wrote:
    > Hi there,
    >
    > I want to run a script after a small delay from reboot to reload
    > the firewall rules. This is because kernel timers start a bit before
    > zero and the timer rules are not quite right until the kernel is into
    > 'positive time'.
    >
    > I suppose I could background a 'sleep nnn' script from rc.local, but
    > wondering what alternatives there are?
    >
    > Is this something 'at' is good for?
    >
    > Other options?
    >
    > Thanks,
    > Grant.


    Any number of the scripts in rc.d use sleep to wait for some event to
    complete. Why re-invent the wheel.....however, that said and FWIW, I seem
    to recall that fcron has an option to run a script on bootup...I can't seem
    to put my hands on the docs and haven't used it on this machine...but I seem
    to recall it.....

    ken

  3. Re: best method to schedule a script a few minutes after boot?

    Grant wrote:
    > Hi there,
    >
    > I want to run a script after a small delay from reboot to reload
    > the firewall rules. This is because kernel timers start a bit before
    > zero and the timer rules are not quite right until the kernel is into
    > 'positive time'.
    >
    > I suppose I could background a 'sleep nnn' script from rc.local, but
    > wondering what alternatives there are?
    >
    > Is this something 'at' is good for?


    For at(1), the time granularity is one minute and basically
    non-determinant due to the delta between queuing and script execution.

    I would add a few seconds sleep or some firewall-specific network check
    at the top of the reload script, then launch from rc.local as a
    background job as you mentioned.

    Cheers,

  4. Re: best method to schedule a script a few minutes after boot?

    Grant wrote:
    > Hi there,
    >
    > I want to run a script after a small delay from reboot to reload
    > the firewall rules. This is because kernel timers start a bit before
    > zero and the timer rules are not quite right until the kernel is into
    > 'positive time'.
    >
    > I suppose I could background a 'sleep nnn' script from rc.local, but
    > wondering what alternatives there are?
    >
    > Is this something 'at' is good for?


    For at(1), the time granularity is one minute and basically
    non-determinant due to the delta between queuing and script execution.

    I would add a few seconds sleep or some firewall-specific network check
    at the top of the reload script, then launch from rc.local as a
    background job as you mentioned.

    Cheers,

  5. Re: best method to schedule a script a few minutes after boot?

    On Sun, 02 Nov 2008 00:52:16 -0500, No_One wrote:

    >On 2008-11-02, Grant wrote:
    >> Hi there,
    >>
    >> I want to run a script after a small delay from reboot to reload
    >> the firewall rules. This is because kernel timers start a bit before
    >> zero and the timer rules are not quite right until the kernel is into
    >> 'positive time'.
    >>
    >> I suppose I could background a 'sleep nnn' script from rc.local, but
    >> wondering what alternatives there are?
    >>

    ....
    >Any number of the scripts in rc.d use sleep to wait for some event to
    >complete. Why re-invent the wheel.....however, that said and FWIW, I seem
    >to recall that fcron has an option to run a script on bootup...I can't seem
    >to put my hands on the docs and haven't used it on this machine...but I seem
    >to recall it.....


    So I settled for:

    ( /usr/bin/sleep 666; /usr/local/bin/firewall ) &

    Grant.
    --
    http://bugsplatter.id.au

+ Reply to Thread