All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Martin Shepherd <mcs@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Xeno-test bug
Date: Sun, 12 Apr 2009 12:36:42 +0200	[thread overview]
Message-ID: <49E1C43A.6060009@domain.hid> (raw)
In-Reply-To: <Pine.LNX.4.64.0904101250540.4820@domain.hid>

Martin Shepherd wrote:
> The xeno-test script doesn't work when /bin/sh isn't bash. In
> particular, under Unbuntu and other recent debian derivatives,
> xeno-test doesn't work, because such distributions use dash instead of
> bash. See:
> 
>    http://en.wikipedia.org/wiki/Debian_Almquist_shell
> 
> Thus, when I run xeno-test on Ubuntu, I see the following:
> 
>    running: generate_loads 1
>    dd workload started, pids 10309 stored in /var/lock/xeno-test.10169.pids
>    10309 pts/0    00:00:00 dd
>    something died a 10309 or
>    something died a 10309 or
>    something died a 10309 or
>    ...ad infinitum...
> 
> However if I change the first line of xeno-test from "#! /bin/sh" to
> "#! /bin/bash", then the script works.
> 
> The source of the problem is an interaction between the statement:
> "eval $* &" in the following procedure, and the exit handler that is set
> up in the generate_loads() procedure.
> 
>    loudly() {
>        [ "$1" = "" ] && return
>        # run task after announcing it
>        echo; date;
>        echo running: $*
>        eval $* &                   # eval helps w complex cmds, like zegrep -E
>        wait $!
>    }
> 
> When the following statement is executed:
> 
>    loudly generate_loads $workload
> 
> "loudly" runs the generate_loads procedure as a background job (via
> the "eval $* &" statement). One of the statements in generate_loads()
> is the following:
> 
>    trap cleanup_load EXIT  # under all exit conditions
> 
> This is clearly intended to terminate the workload process when the
> xeno-test script ends. However because the background_loads procedure
> is executed as a background job (via the "eval $* &" statement of
> loudly()), the cleanup_loads() procedure is called as soon as the
> generate_loads() procedure finishes, not when the parent script that
> ran it via loudly() exits, as appears to have been intended.

No, that is the intended behaviour, as the name "cleanup_load" suggests,
cleanup_load is intended to be called when generate_load terminates. The
real problem is to know why generate_loads terminates early. Maybe you
have not installed dd ?

-- 
					    Gilles.


  parent reply	other threads:[~2009-04-12 10:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08 23:08 [Xenomai-help] Selecting the TSC Martin Shepherd
2009-04-09  0:11 ` Martin Shepherd
2009-04-09  2:49   ` Steven Seeger
2009-04-10 22:15   ` [Xenomai-help] Xeno-test bug Martin Shepherd
2009-04-11  0:20     ` [Xenomai-help] Running xeno-test Martin Shepherd
2009-04-11  0:24       ` Steven Seeger
2009-04-11  0:35         ` Martin Shepherd
2009-04-11 12:39           ` Gilles Chanteperdrix
2009-04-11 20:00             ` Martin Shepherd
2009-04-11 20:07               ` Gilles Chanteperdrix
2009-04-12  2:02                 ` Martin Shepherd
2009-04-12  9:11                   ` Gilles Chanteperdrix
2009-04-12 17:40                     ` Gilles Chanteperdrix
2009-04-12 19:10                     ` Martin Shepherd
2009-04-12 19:23                       ` Gilles Chanteperdrix
2009-04-16  3:20                         ` Martin Shepherd
     [not found]                           ` <4F0B1E98-862D-4031-B22E-D7DAEA554EEB@comcast.net>
     [not found]                             ` <Pine.LNX.4.64.0904161059220.24221@domain.hid>
2009-04-16 18:43                               ` Steven Seeger
2009-04-16 22:18                                 ` Martin Shepherd
2009-04-17  2:50                                 ` Martin Shepherd
     [not found]                           ` <1239872431.5845.25.camel@domain.hid>
     [not found]                             ` <Pine.LNX.4.64.0904161537400.26955@domain.hid>
2009-04-17  8:01                               ` Vikesh Rambaran
2009-04-17 12:57                           ` Gilles Chanteperdrix
2009-04-17 23:34                             ` Martin Shepherd
2009-04-19  5:15                             ` Martin Shepherd
2009-04-12 10:31     ` [Xenomai-help] Xeno-test bug Gilles Chanteperdrix
2009-04-12 10:36     ` Gilles Chanteperdrix [this message]
2009-04-12 18:52       ` Martin Shepherd
2009-04-12 19:25         ` Gilles Chanteperdrix
2009-04-13  0:42           ` Martin Shepherd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49E1C43A.6060009@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=mcs@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.