[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A clean way to introduce delay between scripts in /etc/init.d?



Hi,

Thanks for all your responses.

Indeed ifplugd has a switch -w, which I accidentally
turned off some time ago.  Once I reinstated the switch,
the two scripts (ifplugd and bind9) seemed to be properly
synchronized.

Thanks!

Clement

On Mon, 12 Jun 2006, Joey Hess wrote:

> LEE, Yui-wah (Clement) wrote:
> > What is a clean way to introduce a delay between the
> > scripts in /etc/init.d ?
> >
> > I saw a problem that /etc/rc2.d/S27bind9 started before
> > /etc/rc2.d/S25ifplugd actually completed all the tasks
> > ...
> >
> > Specifically, ifplugd, with the help of resolvconf,
> > would generate the file /var/run/bind/named.options,
> > which would be used by bind9.  Unfortunately by the
> > time bind9 ran, the file was not yet generated.
> >
> > I could force a delay between the two scripts by
> > introducing another script (run at S26) that does
> > nothing but sleep for a fixed time (30 seconds).  That
> > seemed to work around the problem.  But I wonder if
> > there is a cleaner solution.
> >
> > Ideally, the delay should not be fixed but dynamic.
> > That is, a later script can have some means to know for
> > sure that an earlier script has completed all the tasks
> > already.
>
> The best way to accomplish this is to fix the earlier program so that it
> does not return until all tasks are complete.
>
> pcmcia-cs used to have similar problems, which were fixed by making
> cardmgr run with the -f switch. ifplugd has a -w switch that is supposed
> to do the same thing according to at least some of the documentation, and
> is enabled by default. Maybe it's not working though, or doesn't
> actually wait until the interface is up, but just until the initial link
> beat detection is done?
>
>



Reply to: