Re: env question

2010-12-08 Thread Yann E. MORIN
Christopher, Loic, All,

On Wednesday 08 December 2010 21:41:14 Loïc Grenié wrote:
> 2010/12/7 Christopher Barry :
> > I've tried doing:
> > #!/usr/bin/env - /bin/bash
> > and
> > #!/usr/bin/env -i /bin/bash
> >
> > at the top of a script to clear out it's environment prior to running
> > it, but it throws an error.

This is normal behavior. The sha-bang ( #! ) expects the name of the
executable to run, plus one and only one one parameter.

In your case, that one parameter is interpreted as being: '-i /bin/bash'
That is, argv[1] point to a string that contains "-i /bin/bash"

What you would expect is that argv[1]=="-i" and argv[2]=="/bin/bash"
That is not possible.

Regards,
Yann E. MORIN.

-- 
.-..--..
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN |  ___   |
| +33 223 225 172 `.---:  X  AGAINST  |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL|   v   conspiracy.  |
'--^---^--^'
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: env question

2010-12-08 Thread Loïc Grenié
2010/12/7 Christopher Barry :
> Hi,
>
> I've tried doing:
> #!/usr/bin/env - /bin/bash
> and
> #!/usr/bin/env -i /bin/bash
>
> at the top of a script to clear out it's environment prior to running
> it, but it throws an error.

What error ?

Loïc
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: 1.18.0 doesn't build defconfig on Ubuntu 9.04.

2010-12-08 Thread Rob Landley
On Wednesday 08 December 2010 10:38:42 walter harms wrote:
> Rob,
> can you please report the original error ? I did not see it in the ML and
> it seems interessting.

Sorry, the attachements were too big for the mailing list.  (Even compressed.)

Basically, I did a make defconfig and did a make, and it went:

  SPLIT   include/autoconf.h -> include/config/*
  HOSTCC  applets/usage
In file included from applets/usage.c:24:
include/usage.h:23:28: warning: missing terminating " character
In file included from applets/usage.c:24:
include/usage.h:25: error: expected identifier or '(' before string constant
include/usage.h:33:10: warning: missing terminating " character
include/usage.h:33: error: missing terminating " character
include/usage.h:38:26: warning: missing terminating " character
include/usage.h:41:29: warning: missing terminating " character
include/usage.h:40: error: missing terminating " character
include/usage.h:50:24: warning: missing terminating " character
include/usage.h:99:7: warning: missing terminating ' character
include/usage.h:99: error: missing terminating ' character

And so on for pages, because usage.h (and later applets.h) looked like:

/* DO NOT EDIT. This file is generated from usage.src.h */
/* vi: set sw=8 ts=8: */
/*
 * This file suffers from chronically incorrect tabification
 * of messages. Before editing this file:
 * 1. Switch you editor to 8-space tab mode.
 * 2. Do not use \t in messages, use real tab character.
 * 3. Start each source line with message as follows:
 *|<7 spaces>"text with tabs"
 * or
 *|<5 spaces>"\ntext with tabs"
 */
#ifndef BB_USAGE_H
#define BB_USAGE_H 1


#define NOUSAGE_STR "\b"


#define bunzip2_trivial_usage \
   "[-cf] [FILE]..." \

#define bunzip2_full_usage "

" \
   "Decompress FILEs (or stdin)
" \
 "
Options:" \
 "
-c  Write to stdout" \
 "
-f  Force" \

#define bzcat_trivial_usage \
   "FILE" \

#define bzcat_full_usage "

" \
   "Decompress to stdout" \

#define tar_trivial_usage \
   "-[" IF_FEATURE_TAR_CREATE("c") "xt" IF_FEATURE_SEAMLESS_GZ("z") \
IF_FEATURE_SEAMLESS_BZ2("j") IF_FEATURE_SEAMLESS_LZMA("a") \
IF_FEATURE_SEAMLESS_Z("Z") IF_FEATURE_TAR_NOPRESERVE_TIME("m") "vO] " \
IF_FEATURE_TAR_FROM("[-X FILE] ") \
   "[-f TARFILE] [-C DIR] [FILE]..." \


> re,
>  wh

Rob
-- 
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[PATCH] procps/Config.src: Add pstree to FEATURE_THREADS deps. Slight text edit

2010-12-08 Thread Lauri Kasanen
Hi

A small edit to the config entry FEATURE_SHOW_THREADS.

- Lauri

-- 
___
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com



0001-procps-Config.src-Add-pstree-to-FEATURE_THREADS-deps.patch
Description: Binary data
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Re: 1.18.0 doesn't build defconfig on Ubuntu 9.04.

2010-12-08 Thread walter harms


Am 08.12.2010 09:40, schrieb Rob Landley:
> On Tuesday 07 December 2010 23:40:28 Denys Vlasenko wrote:
>> On Wednesday 08 December 2010 06:02, Rob Landley wrote:
>>> Log and first corrupted file attached.  100% reproducible.  I can bisect
>>> it if you like...
>>
>> Does this help?
>>
>> http://busybox.net/downloads/fixes-1.18.0/busybox-1.18.0-buildsys.patch
>>
>> Specifically, this part:
>>
>> -echo "${insert}"
>> +printf "%s\n" "${insert}"
>>  sed -n '/^INSERT$/,$p' "${src}"
>>  else
>>  if [ -n "${insert}" ]; then
>> -echo "ERROR: INSERT line missing in: ${src}" 
>> 1>&2
>> +printf "%s\n" "ERROR: INSERT line missing in: 
>> ${src}" 1>&2
> 
> Yup, that did it.  Thanks.
> 
> Rob

Rob,
can you please report the original error ? I did not see it in the ML and it 
seems interessting.

re,
 wh
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: 1.18.0 doesn't build defconfig on Ubuntu 9.04.

2010-12-08 Thread Rob Landley
On Tuesday 07 December 2010 23:40:28 Denys Vlasenko wrote:
> On Wednesday 08 December 2010 06:02, Rob Landley wrote:
> > Log and first corrupted file attached.  100% reproducible.  I can bisect
> > it if you like...
>
> Does this help?
>
> http://busybox.net/downloads/fixes-1.18.0/busybox-1.18.0-buildsys.patch
>
> Specifically, this part:
>
> - echo "${insert}"
> + printf "%s\n" "${insert}"
>   sed -n '/^INSERT$/,$p' "${src}"
>   else
>   if [ -n "${insert}" ]; then
> - echo "ERROR: INSERT line missing in: ${src}" 
> 1>&2
> + printf "%s\n" "ERROR: INSERT line missing in: 
> ${src}" 1>&2

Yup, that did it.  Thanks.

Rob
-- 
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: 1.18.0 doesn't build defconfig on Ubuntu 9.04.

2010-12-08 Thread Denys Vlasenko
On Wednesday 08 December 2010 06:02, Rob Landley wrote:
> Log and first corrupted file attached.  100% reproducible.  I can bisect it 
> if 
> you like...

Does this help?

http://busybox.net/downloads/fixes-1.18.0/busybox-1.18.0-buildsys.patch

Specifically, this part:

-   echo "${insert}"
+   printf "%s\n" "${insert}"
sed -n '/^INSERT$/,$p' "${src}"
else
if [ -n "${insert}" ]; then
-   echo "ERROR: INSERT line missing in: ${src}" 
1>&2
+   printf "%s\n" "ERROR: INSERT line missing in: 
${src}" 1>&2


-- 
vda
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Bisected the breakage.

2010-12-08 Thread Rob Landley
f718e3a0dbe47ed7ed0398fe4461d33c8f69c669 is first bad commit
commit f718e3a0dbe47ed7ed0398fe4461d33c8f69c669
Author: Mike Frysinger 
Date:   Tue Nov 16 07:29:12 2010 -0500

gen_build_files.sh: rewrite with sed

The shell parsing of files is incredibly slow on many systems.  With
one report, the process was taking a minute or two which made people
thing the build was hung.  So rewrite the craziness with sed and proper
shell functions.  On an idle system, this cut the runtime by half.

Signed-off-by: Mike Frysinger 

Before that, defconfig built fine on ubuntu 9.04.  After that, the files were 
corrupted ala the attachments in my previous message, and the build broke.

Rob
-- 
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: Can I rely absolutely on what happens when a process dies.

2010-12-08 Thread Denys Vlasenko
On Tuesday 07 December 2010 18:40, David Collier wrote:
> > What are you trying to achieve on a bigger scale?
> > (I mean, using the pid from pidfile is an element of some
> > bigger plan of yours. What is it?)
> 
> thanks
> 
> I'll take my chances on the shell going away - I can't have a perfect
> world.
> ( there is a h/w watchdog about which might pick that up )
> 
> what I'm about is as described in
> 
> *From:* "David Collier" 
> *To:* busybox@busybox.net
> *Date:* Mon, 6 Dec 2010 11:09 + (GMT Standard Time)
> 
> I have seen your reply suggesting runsv - and I will think about going
> that way, but in the meantime I need my existing knife-and-fork scripting
> to sort-of-work.

runsv and runsvdir rely on the "parent-child" relationship to watch
the child. Which is 100% safe, unlike pidfiles or pidof.

Also, runsvdor -> runsv -> service is a nested set of babysitters.
It would take a serious anti-luck to accidentally break that.

But still, if runsvdir is killed, then you lose a top-level
babysitter.

As an additional protection against that,
on one particularly critical system I had a service which
in turn watched *runsvdir*, and if it was gone, it was
shutting down all services, then killing all runsv's,
then restarting runsvdir (which restarts all services).

-- 
vda
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: Can I rely absolutely on what happens when a process dies.

2010-12-08 Thread Johannes Stezenbach
On Tue, Dec 07, 2010 at 11:43:53AM +, Bob Dunlop wrote:
> > Pid files are not very robust in general.
> 
> You can make you kill script a bit more robust with a simple check.  Get
> the pid from the file and examine "/proc//cmdline" which should
> contain the name of the dhcp process as the first null terminated string.
> You can't use "/proc//exe" for this because that will just be
> pointing at busybox.  If the name matches you're on to a reasonable bet
> that you are killing the right thing.

start_stop_daemon already implements that, right?

Johannes
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


env question

2010-12-08 Thread Christopher Barry
Hi,

I've tried doing:
#!/usr/bin/env - /bin/bash
and
#!/usr/bin/env -i /bin/bash

at the top of a script to clear out it's environment prior to running
it, but it throws an error.

Is there  a better way to accomplish what I'm trying to do?


Thanks
-C


___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox