multiple instances of the same script?

Scott James Remnant scott at netsplit.com
Sun Mar 11 12:18:54 GMT 2007


On Sun, 2007-03-11 at 10:49 +0100, paul wrote:

> The problem is when I emit a shutdown event "initctl emit shutdown" 
> initcl does not return. It waits for ever.
> 
> When I comment the "instance" stanza in the script every things behaves 
> as expected.
> 
This is interesting; I would expect shutdown to wait until every job had
stopped.  Not sure why it's hanging though.

It could be that a stopped job is unexpectedly taking hold of the
emission and locking it?  I will investigate.

> Also start show-ids hangs (script is called test)
> 
>     # start --show-ids test
>     test [#20] (start) waiting
>     test [#20] (start) starting
>     test [#20] (start) pre-start, process 763
>     test [#20] (start) spawned
>     test [#20] (start) post-start
>     test [#20] (start) running
>     and hangs here...
> 
This is normal.  You defined a task, so the expected result is for that
task to complete -- since you didn't define any main process for the
job, the only way it will stop is by stopping it manually or by an
event.

Either add "exec echo" or similar to it, you'll then see:

    # start --show-ids test
    test [#20] (start) waiting
    test [#20] (start) starting
    test [#20] (start) pre-start, process 763
    test [#20] (start) spawned
    test [#20] (start) post-start
    test [#20] (start) running
    test [#20] (stop) pre-stop
    test [#20] (stop) stopping
    test [#20] (stop) killed
    test [#20] (stop) post-stop, process NNN
    test [#20] (stop) waiting

(Note how "start" blocks until it gets back to stop/waiting).

Or add "service" to it, start will then only block until it reaches start/running.


The theory here is that "start filesystem-check" should wait for the
filesystem check to be completed, otherwise it can't report whether it
failed or not.

You can always use "start --no-wait" as well.

> Besides I see some more (same?) issues. My fs-check and network script 
> are now using "instance". After boot I see with ps that the emit in udev 
> does not finish. Is this a bug, or do I not understand the behavior?
> 
Likewise, emit will block until the tasks are stopped;  you may have
actually intended them to be services.

Scott
-- 
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20070311/b2e60a70/attachment.pgp 


More information about the upstart-devel mailing list