Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2012 23:53:49 -0400
From:      Jason Hellenthal <jhellenthal@dataix.net>
To:        Alexander Pronin <scher@freebsd.org>
Cc:        Marcus von Appen <mva@freebsd.org>, freebsd-stable@freebsd.org, freebsd-ports@freebsd.org
Subject:   Re: [ GSOC ] Differences in shell behaviour
Message-ID:  <20120601035349.GA97671@DataIX.net>
In-Reply-To: <4E946838-4F3B-421A-839E-05E1A01464AB@FreeBSD.org>
References:  <4E946838-4F3B-421A-839E-05E1A01464AB@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On Thu, May 31, 2012 at 11:21:10PM +0400, Alexander Pronin wrote:
> Hello everyone!
> I am GSOC student at FreeBSD Project.
> So my GSOC Project is "Parallelization in the ports collection".
> You may checkout wiki page of this project: http://wiki.freebsd.org/SummerOfCode2012/Parallelization_in_the_ports_collection
> 
> Is it suitable to write sh script for 9.0, that does not work in 8.3?
> 
> To sum up, the scenario is as following:
> I need to spawn some processes in background to build port's dependencies.
> Store their pids.
> Wait for a while or do some stuff.
> explore exit codes of spawned processes by their pids.
> 
> The problem is:
> ### sh in 8.3
> $ false & pid=$!
> $ 
> [1]   Done (1)                false
> $ wait ${pid}
> wait: No such job: 4852

I don't see this behavior on 8.3-STABLE @r236350 i386
 ---
Console> false & pid=$!
Console> wait ${pid}
[1]   Done (1)                false
Console> echo $?
1
Console>

Using (builtin false) or (/usr/bin/false) I get the same results. Is
this a GENERIC system your working on ? And is this a blank user account
with no login.conf or profile modifications ?

 ---

ident /bin/sh ... for reference.
/bin/sh:
     $FreeBSD: stable/8/lib/csu/i386-elf/crti.S 146369 2005-05-19 07:31:06Z dfr $
     $FreeBSD: stable/8/lib/csu/i386-elf/crtn.S 146369 2005-05-19 07:31:06Z dfr $
     $FreeBSD: stable/8/lib/csu/i386-elf/crt1_s.S 217470 2011-01-16 10:41:47Z kib $
     $FreeBSD: stable/8/lib/csu/common/crtbrand.c 174251 2007-12-04 12:18:43Z kib $
     $FreeBSD: stable/8/bin/sh/alias.c 214113 2010-10-20 18:25:00Z obrien $
     $FreeBSD: stable/8/bin/sh/arith.y 213390 2010-10-03 21:56:20Z jilles $
     $FreeBSD: stable/8/bin/sh/arith_lex.l 234001 2012-04-07 20:52:21Z jilles $
     $FreeBSD: stable/8/bin/sh/cd.c 214113 2010-10-20 18:25:00Z obrien $
     $FreeBSD: stable/8/bin/sh/bltin/echo.c 127958 2004-04-06 20:06:54Z markm $
     $FreeBSD: stable/8/bin/sh/error.c 214123 2010-10-21 01:13:41Z obrien $
     $FreeBSD: stable/8/bin/sh/eval.c 231086 2012-02-06 13:36:49Z dumbbell $
     $FreeBSD: stable/8/bin/sh/exec.c 214113 2010-10-20 18:25:00Z obrien $
     $FreeBSD: stable/8/bin/sh/expand.c 218992 2011-02-24 10:23:22Z brucec $
     $FreeBSD: stable/8/bin/sh/histedit.c 217485 2011-01-16 22:10:18Z jilles $
     $FreeBSD: stable/8/bin/sh/input.c 214113 2010-10-20 18:25:00Z obrien $
     $FreeBSD: stable/8/bin/sh/jobs.c 222208 2011-05-22 22:28:07Z jilles $
     $FreeBSD: stable/8/bin/sh/mail.c 214113 2010-10-20 18:25:00Z obrien $
     $FreeBSD: stable/8/bin/sh/main.c 222452 2011-05-29 15:07:53Z jilles $
     $FreeBSD: stable/8/bin/sh/memalloc.c 214190 2010-10-21 23:45:57Z obrien $
     $FreeBSD: stable/8/bin/sh/miscbltin.c 213390 2010-10-03 21:56:20Z jilles $
     $FreeBSD: stable/8/bin/sh/mystring.c 213390 2010-10-03 21:56:20Z jilles $
     $FreeBSD: stable/8/bin/sh/options.c 221515 2011-05-05 22:07:02Z jilles $
     $FreeBSD: stable/8/bin/sh/output.c 214113 2010-10-20 18:25:00Z obrien $
     $FreeBSD: stable/8/bin/sh/parser.c 221522 2011-05-06 12:49:32Z jilles $
     $FreeBSD: stable/8/bin/sh/redir.c 214113 2010-10-20 18:25:00Z obrien $
     $FreeBSD: stable/8/bin/sh/show.c 214113 2010-10-20 18:25:00Z obrien $
     $FreeBSD: stable/8/bin/test/test.c 220250 2011-04-01 18:23:44Z delphij $
     $FreeBSD: stable/8/bin/sh/trap.c 231086 2012-02-06 13:36:49Z dumbbell $
     $FreeBSD: stable/8/bin/sh/var.c 231531 2012-02-11 20:37:08Z jilles $


/usr/bin/false:
     $FreeBSD: stable/8/lib/csu/i386-elf/crti.S 146369 2005-05-19 07:31:06Z dfr $
     $FreeBSD: stable/8/lib/csu/i386-elf/crtn.S 146369 2005-05-19 07:31:06Z dfr $
     $FreeBSD: stable/8/lib/csu/i386-elf/crt1_s.S 217470 2011-01-16 10:41:47Z kib $
     $FreeBSD: stable/8/lib/csu/common/crtbrand.c 174251 2007-12-04 12:18:43Z kib $
     $FreeBSD: stable/8/usr.bin/false/false.c 111107 2003-02-19 00:10:28Z peter $

> 
> -----------------------
> ### sh in releng9
> $ false & pid=$!
> $ 
> [1]   Done(1)                 false
> $ wait ${pid}
> $ echo $?
> 1
> $
> 
> I am currently working in releng9 environment, so the result suits my needs.
> 
> But, is it suitable to write sh script for 9.0, that does not work in 8.3?
> 
> _______________________________________________
> freebsd-ports@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"

-- 

 - (2^(N-1))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120601035349.GA97671>