Re: slattach shrinkage? [was: Re: svn commit: trunk/busybox: include networking]

2007-06-21 Thread Denis Vlasenko
On Wednesday 20 June 2007 18:24, Bernhard Fischer wrote:
 On Wed, Jun 20, 2007 at 06:02:22PM +0200, Bernhard Fischer wrote:
 On Wed, Jun 20, 2007 at 08:23:04AM -0700, [EMAIL PROTECTED] wrote:
 Author: vda
 Date: 2007-06-20 08:23:03 -0700 (Wed, 20 Jun 2007)
 New Revision: 18873
 
 Log:
 slattach: new applet.
 
 What about the attached, untested, trivial shrinkage?
 
 $ size networking/slattach.o*
textdata bss dec hex filename
1085   0   01085 43d networking/slattach.o.oorig
1053   0   01053 41d networking/slattach.o
 
 vda, please apply if that's ok.
 cheers,
 
 and that tcsetattr could perhaps be made smaller, too. Something like in
 the attached incremental patch..

Thank you. Applied to svn.
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: wget support for no_proxy env var

2007-06-21 Thread walter harms
hi Dan,
gnu libc supports argz (GNU extension) for mapping lists line a,b,c,d into 
arrays and back
unfortunately there is no official man page but you can use my from
http://www.freiburg.linux.de/projekte/manpages/man/argz/

when you have problems getting it to work i have some examples around but i 
must search them.

re,
 wh




dann frazier wrote:
 On Tue, Jun 19, 2007 at 10:30:55AM +0200, Bernhard Fischer wrote:
 On Mon, Jun 18, 2007 at 03:23:20PM -0600, dann frazier wrote:
 hey,
 The following patch adds support for the no_proxy envvar to the wget
 applet. Most of the code is lifted directly from GNU's wget source
 (with a few simplifications). This is my first contribution to
 busybox and a rare attempt at C for me - let me know if I should
 reduce wrap this code in a config option, etc.
 Yes, please wrap that in a config option.
 
 ok
 
 +bool sufmatch (char **list, const char *what);
 +bool sufmatch (char **list, const char *what)
 +{
 +   int i, j, k, lw;
 +
 +   lw = strlen (what);
 +   for (i = 0; list[i]; i++) {
 +   for (j = strlen (list[i]), k = lw; j = 0  k = 0; j--, k--) 
 +   if (tolower (list[i][j]) != tolower (what[k]))
 +   break;
 +   /* The domain must be first to reach to beginning.  */
 +   if (j == -1)
 +   return true;
 +   }
 +   return false;
 +}
 This sounds alike index_in_substr_array(). Perhaps you can reuse this
 instead? (See also str_tolower())
 
 I don't see a good way to use index_in_substr_array() since I only
 care if the last part of the string matches. str_tolower() does come
 in handy though, thanks for the suggestion.
 
 Here's a new version of the patch with these changes:
 

___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: ctrl-c doesn't work but ctrl-z is ok in telnet

2007-06-21 Thread Bernhard Fischer
On Thu, Jun 21, 2007 at 10:51:21AM +0800, Bin Chen wrote:

I am using busybox-1.1 and I found the ctrl-c can't work when I
telnet
into the board, but ctrl-z can work.
   
Any idea?

Does it work with current trunk or at least 1.6.0?
Did you read the FAQ (there is a ctrl-c entry)?
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


[PATCH] Fix another httpd breakage on no-MMU

2007-06-21 Thread Alex Landau
Hi,

Another round of fixes to httpd for no-MMU.
httpd can't work in non-inetd mode since it is required to fork for each 
connection.
There are 2 approaches I can think of:
1. The correct one: on connection, the parent vforks and the child reexecs 
itself to
serve the connection.
2. The easy one: require -i (inetd mode) and #ifdef the code that prevents 
compilation on
no-mmu (the code running bb_daemonize).

The attached patch goes the second way for 2 reasons. First, the second way is 
much
easier, so we get a working httpd. Second, I'm not sure that it's benefiting to 
reexec
httpd on every connection, since inetd does exactly that. And, of course, the 
most
important reason: I'm lazy ;-)

Alex

P.S. On compilation a warning shows telling that openServer() is defined but 
not used.
This function is used only in non-inetd mode. I did not wrap it in #if !BB_MMU 
since if
later someone goes with way 1 (above), he'll need it, and since it's static, it 
does not
reach the .o file.


 

8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#newsIndex: networking/httpd.c
===
--- networking/httpd.c	(revision 18873)
+++ networking/httpd.c	(working copy)
@@ -1821,6 +1821,7 @@
 	close(accepted_socket);
 }
 
+#if BB_MMU
 /
  *
   $Function: miniHttpd()
@@ -1900,6 +1901,7 @@
 	} /* while (1) */
 	return 0;
 }
+#endif
 
 /* from inetd */
 static int miniHttpd_inetd(void)
@@ -2033,6 +2035,7 @@
 
 	xchdir(home_httpd);
 	if (!(opt  OPT_INETD)) {
+#if BB_MMU
 		signal(SIGCHLD, SIG_IGN);
 		server_socket = openServer();
 #if ENABLE_FEATURE_HTTPD_SETUID
@@ -2046,6 +2049,9 @@
 			xsetuid(ugid.uid);
 		}
 #endif
+#else	/* BB_MMU */
+		bb_error_msg_and_die(-i is required);
+#endif
 	}
 
 #if ENABLE_FEATURE_HTTPD_CGI
@@ -2069,7 +2075,11 @@
 	if (opt  OPT_INETD)
 		return miniHttpd_inetd();
 
+#if BB_MMU
 	if (!(opt  OPT_FOREGROUND))
 		bb_daemonize(0); /* don't change current directory */
 	return miniHttpd(server_socket);
+#else
+	return 0;/* not reached */
+#endif
 }
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Re: ctrl-c doesn't work but ctrl-z is ok in telnet

2007-06-21 Thread Bin Chen


在 2007-06-21四的 10:31 +0200,Bernhard Fischer写道:
 On Thu, Jun 21, 2007 at 10:51:21AM +0800, Bin Chen wrote:
 
 I am using busybox-1.1 and I found the ctrl-c can't work when I
 telnet
 into the board, but ctrl-z can work.

 Any idea?
 
 Does it work with current trunk or at least 1.6.0?
 Did you read the FAQ (there is a ctrl-c entry)?

I have not tried a higher version. I do read the FAQ and I know
the /dev/console need to modified, but I mean telnet, which is pty not
serial port.

___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Re: [PATCH] tar: enhanced compatibility to old versions

2007-06-21 Thread Denis Vlasenko
On Wednesday 20 June 2007 22:41, Harald KЭthe wrote:
 Hello list,
 
 bb-1.6.0 is not able to unpack the attached file 
 (ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY is set)
 Following patch adds support for e.g. checksums with spaces as delimiter.
 
 Best regards
 Harald

Applied. But:

 patch:
 --- busybox-1.6.0.orig/archival/libunarchive/get_header_tar.c 2007-06-01 
 13:48:31.0 +0200
 +++ busybox-1.6.0/archival/libunarchive/get_header_tar.c 2007-06-20 
 22:11:19.0 +0200
 ...

# patch -p1 /tmp/old_tar.txt --dry-run
patching file archival/libunarchive/get_header_tar.c
Hunk #1 FAILED at 36.
Hunk #2 FAILED at 127.
2 out of 2 hunks FAILED -- saving rejects to file 
archival/libunarchive/get_header_tar.c.rej

 begin 666 bb-test.tar.gz
 M'XL(`RHN34K)+#+4+TDM+M$KJ2AAH $P-# P,S%18%!0,#0T1JA
 MP,A(P=# S-C4U-3(S-P*!N;RLP# *: ]R,O-2#;E I!8-.8:#9-1, I
 [EMAIL PROTECTED]0#__P,`JEYDP`(
 `
 end

Do you use uuencode just because it's cool? It's also harder to use
(most newer mail readers won't have tools to unpack it,
need to do it by hand).
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Re: correct searchpath for configdata

2007-06-21 Thread Denis Vlasenko
On Wednesday 20 June 2007 14:29, walter harms wrote:
 ups, this should be the correct file ...
 
 re,
  walter
 
 
 Bernhard Fischer wrote:
  On Wed, Jun 20, 2007 at 01:40:33PM +0200, walter harms wrote:
  hi list,
  i was wondering why bb-1.6 produced a whole bunch of warnings for my 
  .config even
  when freshly unpacked. More over i had random bits selected while  most 
  other stuff was
  empty, an indication that defconfig was never loaded.
 
  This patch fixes that by changing the searched files. IMHO it makes no 
  sence to
  load /boot/config-xxx and some others, i did some tests and had no 
  problems.
 
  please apply,

Applied, thanks!
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: bb-1.6: test.c ‘i’ may be used uninitialized

2007-06-21 Thread Denis Vlasenko
On Wednesday 20 June 2007 14:09, walter harms wrote:
 hi list,
 i do not know if it is are real problem ... but it should be fixed
 perhaps i=0 ?
 btw: this happends also with latest snapshot

When I see that gcc simply doesn't realize it is okay,
for space reasons I use int i = i - no code is generated.

 int test_main(int argc, char **argv);
 int test_main(int argc, char **argv)
 {
 return bb_test(argc, argv);
 }

Hmmm... indeed. Removing...
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: udhcpc problem

2007-06-21 Thread Denis Vlasenko
On Tuesday 19 June 2007 04:17, Bin Chen wrote:
 
 Hi,
 
 When the udhcpc is started, it begins to broadcast the DHCP
 discover
 message. Can I pass some arguments to udhcpc to let it just
 reside in
 memory but not do any action until I tell it to do using signal
 SIGUSR1
 or SIGUSR2?

#!/bin/sh
trap exec udhcpc  USR1
echo $$
while true; do
sleep 99 
wait
done

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


Re: Question about syslogd and TAB characters?

2007-06-21 Thread Denis Vlasenko
On Monday 18 June 2007 19:10, Dennis Smith wrote:
 Hello,
 
 I am using busybox ver. 1.00
 
 I send a log message via syslog that includes \t (horizontal tab) in the
 message.  When I look a the log file (\var\log\messages), instead of the 
 expected
 tab, I see ^I in the logged message.  Granted, that is the control sequence 
 for tabs, 
 but on another system that does not use busy box, I see the expected tab in 
 the file, 
 which is preferrable when trying to line up columns of data in your logging 
 files.
 
 Questions
 1. Is this a bug with the syslogd included with busybox?
 2. Is there a fix for this in a later release of busybox?, which release is 
 it in?
 3. If there is no fix available at this time, can someone investigate this, 
 and provide a fix?
 4. If someone will look into it, approximately how long will it be before 
 they do?

Fixed in svn, will be in 1.7.0
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


ARRAY_SIZE

2007-06-21 Thread walter harms
Hi list,
the kernel janitor were removing different versions of ARRAY_SIZE()
from the kernel tree. i used the check to look for the same phenomena
in busybox.
Since this is not exactly about saving space more about maintaining,
will such a patch accepted ?

re,
 wh


use to check:
grep -Er sizeof ?\(?([^\)]+)\)? ?/ ?sizeof ?\(?.*\1.* *

kj wiki: http://fsdev.net/wiki/index.php?title=ARRAY_SIZE
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


telnetd gives problems

2007-06-21 Thread Chandrasekhar Nagaraj
Hi,

 

I am using busybox-1.4.2 for a PPC440GX based board.

I intend to run the telnetd daemon on the board. The telnetd has been
compiled with the Support standalone telnetd (not inetd only) option.
Also the LOGIN and FEATURE_SUID features have been enabled in Busybox.

 

But when I try to telnet to this board (after the telnetd daemon has
been started) I get the following error

#telnet 192.168.1.205

Trying 192.168.1.205...

Connected to 192.168.1.205 (192.168.1.205).

Escape character is '^]'.

Connection closed by foreign host.

 

 

The kernel has UNIX98_PTYS and DEVPTS_FS enabled.

At the RFS end, the /dev/pts directories are created, /dev/ptmx device
file is created and also the devpts FS is mounted.

 

Are there any other settings that I am missing?

 

Thanks and Regards

Sekhar

 

___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Re: how can I determine the root device?

2007-06-21 Thread Dallas Clement
Hi Mike,  Thanks for the reply.  I guess what I am really trying to
determine is which device I booted Linux from.  Do you know of any way
to do that?  I am booting into initramfs and I would like to determine
the boot device major/minor numbers while running my init script.

On 6/20/07, Mike Frysinger [EMAIL PROTECTED] wrote:
 On Wednesday 20 June 2007, Dallas Clement wrote:
  Does anyone know of a way to determine the root device from which the
  kernel has been booted?  I've heard of a utility called rdev which
  will do this.  Just wondering if something like this is included in
  busybox or if there is a way to determine this from files found in the
  proc filesystem or something...

 rdev works by comparing the major/minor from stat(/) to the major/minor of
 the device nodes in /dev/

 depending on what you want to do, /dev/root may also work
 -mike


___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: wget support for no_proxy env var

2007-06-21 Thread walter harms


Bernhard Fischer wrote:
 On Thu, Jun 21, 2007 at 09:08:58AM +0200, walter harms wrote:
 hi Dan,
 gnu libc supports argz (GNU extension) for mapping lists line a,b,c,d into 
 arrays and back
 unfortunately there is no official man page but you can use my from
 http://www.freiburg.linux.de/projekte/manpages/man/argz/

 when you have problems getting it to work i have some examples around but i 
 must search them.
 
 Don't forget to provide a mechanism that detects the availability of
 this non-standard extension and also do not forget to provide a
 fallback, IFF you go down that route.


i agree that it is not clever to use non-standard extension, but he has the 
code in its basics already.
now rule 2 kicks in do not reinvent the wheel, argz is a defined interface in 
glibc and if he sticks
with that API:
1. he can use glibc code and save space
2. he can use his own code if needed

We have some that that need to split at a delimiter and store (e.g. sort). IMHO 
it would help to join the
functionality.

re,
 wh



___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


task/process managment does not work

2007-06-21 Thread Miroslaw Dach
Hi Hamish,

Thank you for your answer.

On Wed, Jun 20, 2007 at 11:00:33AM +0200, Miroslaw Dach wrote:
  I have recompiled several times the busybox and each time when I 
 boot my embedded linux ppc405 board with busy box I have difficulties 
to 
 manage tasks. 
 
 My observation is as following:
 
 top: can't find process info in /proc
 The /proc directory is simply empty
 Is it somehow possible to enable process managing?

Mount /proc?

mount -t proc none /proc

I have mounted proc manually and now it is no problem with ps and top.

I wonder however why it does not work straight after boot-up and I have to 
do mount explicitly.


 #!../../../bin/ash

?? Write /bin/ash. You don't know what directory the script will run
from so don't use relative directories.

you are absolutely right.

Best Regards

Mirek

=
  Miroslaw Dach ([EMAIL PROTECTED]) - SLS/Controls Group 
PSI - Paul Scherrer Institut CH-5232 Villigen
=

___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


RE: Busybox memory

2007-06-21 Thread Martinb_ARM_NOMMU_KISSDVD
I can only tell about my personal experience (as a user)

if I compile 1 busybox with telnetd,crond,httpd,lash,hush,free and I will
type free I will get less mem then if I create  separated
httpd,lash,telnetd,inetd etc etc
the difference is so big that i split (almost) all the busybox applets in
small parts
so if mem is really important (and since I only have 4MB free it is) I
advise to split them

I advise to make the same test yourself so you will know for sure what the
best option is

but I’m curious for the experts advise on this matter

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Alex Kums
Verzonden: donderdag 21 juni 2007 18:50
Aan: busybox@busybox.net
Onderwerp: Busybox  memory


Hi.

I have a question about memory usage in busybox. Say, busybox eat 100 Kb
of memory. If I run telnetd, cron and httpd, will these three instances of
busybox eat 300 Kb ?

Thanks.


-
Туристический портал VP.BY - 'Все Путевки': каталог турфирм Беларуси,
отдых на море, туры по Европе, отдых в Беларуси. Есть ГОРЯЩИЕ туры!
http://vp.by/ -  здесь выбирают ОТДЫХ и делятся впечатлениями!


___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

syslogd question

2007-06-21 Thread Dennis Smith
Hello,

I am using busybox ver. 1.00

I am using syslogd with some logging code I wrote for my project.

Currently I can configure the logging level... to say 4, then all log messages 
at levels
higher then that, 5, 6, and 7 do not show up in my /var/log/messages file.

What I want to be able to do, is change the configured logging level, and have 
that change
what files the log messages go to.  That way anyone looking at the messages 
file will not 
see higher level logging, but the log messages are not lost, but rather just 
sent to a different file.

To do this, I need syslogd to support the /etc/syslog.conf file.

Questions
1. My understanding is that the syslogd in busybox ignores syslog.conf, is that 
right?
2. If so, will a future release support the syslog.conf file?
3. If not, is there some other way my goal can be accomplished with the 
syslogd included with busybox?
4. If not, if the size of syslogd is a problem, perhaps an option be 
included with busybox to select either the syslogd that supports syslog.conf, 
or the one that does not?
5. If someone will look into this, approximately how long will it be before 
they do?

Thanks in advance,

Dennis Smith

___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: [PATCH] tar: enhanced compatibility to old versions

2007-06-21 Thread Harald Kuthe
Hello Denis,
Do you use uuencode just because it's cool? It's also harder to use
(most newer mail readers won't have tools to unpack it,
need to do it by hand).
no I'm using Outlook Express and had just attached the file and included the 
patch inline in the mail.
...
I saw that uuencode was set to the default mail format - fixed

Thanx for pointing that out.
Best regards
Harald

- Original Message - 
From: Denis Vlasenko [EMAIL PROTECTED]
To: busybox@busybox.net
Cc: Harald Küthe [EMAIL PROTECTED]
Sent: Thursday, June 21, 2007 2:53 PM
Subject: Re: [PATCH] tar: enhanced compatibility to old versions


On Wednesday 20 June 2007 22:41, Harald Küthe wrote:
 Hello list,

 bb-1.6.0 is not able to unpack the attached file
 (ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY is set)
 Following patch adds support for e.g. checksums with spaces as delimiter.

 Best regards
 Harald

Applied. But:

 patch:
 --- busybox-1.6.0.orig/archival/libunarchive/get_header_tar.c 2007-06-01
 13:48:31.0 +0200
 +++ busybox-1.6.0/archival/libunarchive/get_header_tar.c 2007-06-20
 22:11:19.0 +0200
 ...

# patch -p1 /tmp/old_tar.txt --dry-run
patching file archival/libunarchive/get_header_tar.c
Hunk #1 FAILED at 36.
Hunk #2 FAILED at 127.
2 out of 2 hunks FAILED -- saving rejects to file 
archival/libunarchive/get_header_tar.c.rej

 begin 666 bb-test.tar.gz
 M'XL(`RHN34K)+#+4+TDM+M$KJ2AAH $P-# P,S%18%!0,#0T1JA
 MP,A(P=# S-C4U-3(S-P*!N;RLP# *: ]R,O-2#;E I!8-.8:#9-1, I
 [EMAIL PROTECTED]0#__P,`JEYDP`(
 `
 end

Do you use uuencode just because it's cool? It's also harder to use
(most newer mail readers won't have tools to unpack it,
need to do it by hand).
--
vda 


___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Re: task/process managment does not work

2007-06-21 Thread Tito
On Thursday 21 June 2007 17:23:18 Miroslaw Dach wrote:
 Hi Hamish,
 
 Thank you for your answer.
 
 On Wed, Jun 20, 2007 at 11:00:33AM +0200, Miroslaw Dach wrote:
 I have recompiled several times the busybox and each time when I 
  boot my embedded linux ppc405 board with busy box I have difficulties 
 to 
  manage tasks. 
  
  My observation is as following:
  
  top: can't find process info in /proc
  The /proc directory is simply empty
  Is it somehow possible to enable process managing?
 
 Mount /proc?
 
 mount -t proc none /proc
 
 I have mounted proc manually and now it is no problem with ps and top.
 
 I wonder however why it does not work straight after boot-up and I have to 
 do mount explicitly.

Maybe you can add a line to your /etc/fstab

proc/proc   procdefaults0   0

Ciao,
Tito
 
  #!../../../bin/ash
 
 ?? Write /bin/ash. You don't know what directory the script will run
 from so don't use relative directories.
 
 you are absolutely right.
 
 Best Regards
 
 Mirek
 
 =
   Miroslaw Dach ([EMAIL PROTECTED]) - SLS/Controls Group 
 PSI - Paul Scherrer Institut CH-5232 Villigen
 =
 
 ___
 busybox mailing list
 busybox@busybox.net
 http://busybox.net/cgi-bin/mailman/listinfo/busybox
 


___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: ARRAY_SIZE

2007-06-21 Thread Denis Vlasenko
On Thursday 21 June 2007 15:50, walter harms wrote:
 Hi list,
 the kernel janitor were removing different versions of ARRAY_SIZE()
 from the kernel tree. i used the check to look for the same phenomena
 in busybox.
 Since this is not exactly about saving space more about maintaining,
 will such a patch accepted ?

Yes.

I suppose you want to just #define one macro in libbb.h
and convert all other instances.
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Re: task/process managment does not work

2007-06-21 Thread Denis Vlasenko
On Thursday 21 June 2007 17:23, Miroslaw Dach wrote:
  My observation is as following:
  
  top: can't find process info in /proc
  The /proc directory is simply empty
  Is it somehow possible to enable process managing?
 
 Mount /proc?
 
 mount -t proc none /proc
 
 I have mounted proc manually and now it is no problem with ps and top.
 
 I wonder however why it does not work straight after boot-up and I have to 
 do mount explicitly.

Because nothing is mounted automatically, by itself, etc.
Some script, somewhere in the boot process, is running appropriate
mount command.

You need to look thru your boot scripts and fix (or add) mount commands.
--
vda
___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox


Is it a bug of killall/pidof?

2007-06-21 Thread john bigZ
Hi,
  I was wondering why my kill script didn't work. the reason I found that the 
'killall' failed with 'no process killed', was 'killall' called 'pidof', 
'pidof' didn't return a process id for the given process name. After through 
investigation of the busybox sourcecode, I found out, that pidof doesn't parse 
/proc/$PID/cmdline for the process name instead it cuts out the text between 
the round braces in /proc/$PID/stat. This text usually contains the name of 
argv[0] and somehow this text contains exe instead of the real process name 
itself. pidof/killall will then not be able to find the PID to the given 
process name (you may try pidof exe instead, if you don't believe me).
  I don't know how to fix this problem, can anyone help me or give me some 
hints? I'd appreciate your help!
   
  Regards,
   
  John
   
  --
  the experiment I did listed below, (first I tried to kill all the processes 
named 'syslogd', it failed. Then I tried to kill all the httpd processes, it 
worked as /proc/$PID/stat contained the right process name).
   
  firewall# ps -ef
  PID  Uid VmSize Stat Command
1 root288 S   init
2 rootSW  [keventd]
3 rootSWN  [ksoftirqd_CPU0]
4 rootSW  [kswapd]
5 rootSW  [bdflush]
6 rootSW  [kupdated]
7 rootSW  [khubd]
  645 root280 S   syslogd -m 0 -C
  646 root264 S   klogd
  850 root280 S   syslogd -m 0 -C
  856 root264 S   klogd -c 1
  892 root304 S   /usr/sbin/sshd -p 22
  905  root   3588 S   /usr/local/sbin/httpd -f /etc/httpd.conf
  922 root292 S   crond -L /dev/null
  926 root272 S   /sbin/getty 38400 tty1
  927 root272 S   /sbin/getty 38400 tty2
  928 root272 S   /sbin/getty 38400 tty3
  929 root   5092 S   /usr/local/sbin/httpd -f /etc/httpd.conf
  946 root   5048 S   /usr/local/sbin/httpd -f /etc/httpd.conf
  977 root428 R   /usr/sbin/sshd -p 22
  978 root332 S   -sh
 1031 root252  R   ps -ef
firewall# killall -9 syslogd
killall: syslogd: no process killed
firewall#
  firewall# cat /proc/850/stat
850 (exe) S 1 849 849 0 -1 64 12 0 15 0 0 4 0 0 9 0 0 0 980 1077248 70 
4294967295 134512640 134770336 3221225008 3221224576 1074021311 0 0 69633 24582 
3222503337 0 0 17 0
firewall# cat /proc/946/stat
946 (httpd) S 905 905 905 0 -1 320 552 438 108 1565 16 18 0 12 9 0 0 0 26755 621
3632 1262 4294967295 134512640 136027432 3221224992 3221224364 1074081392 0 0 40
96 71329387 3223297762 0 0 17 0
firewall# killall -9 httpd
firewall# ps -ef
  PID  Uid VmSize Stat Command
1 root288 S   init
2 rootSW  [keventd]
3  rootSWN [ksoftirqd_CPU0]
4 rootSW  [kswapd]
5 rootSW  [bdflush]
6 rootSW  [kupdated]
7 rootSW  [khubd]
  645 root284 S   syslogd -m 0 -C
  646 root264 S   klogd
  850 root280 S   syslogd -m 0 -C
  856 root264 S   klogd -c 1
  892 root304  S   /usr/sbin/sshd -p 22
  922 root292 S   crond -L /dev/null
  926 root272 S   /sbin/getty 38400 tty1
  927 root272 S   /sbin/getty 38400 tty2
  928 root272 S   /sbin/getty 38400 tty3
  977 root428 R   /usr/sbin/sshd -p 22
  978 root332 S   -sh
 1039 root252 R   ps -ef
firewall#
syslogd-m0-Cfirewall# busybox
BusyBox v1.2.1 (2007.04.23-19:37+) multi-call binary
  Usage: busybox [function] [arguments]...
   or: [function] [arguments]...
  BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable.  Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as!
  Currently defined functions:
[, [[, arping, ash, basename, busybox, cat, chmod, chown, clear, cp, 
crond, crontab, cut, date, dd, df, dirname,
dmesg, dos2unix, du, echo, false, fgrep, find, free, getopt, getty, 
grep, gunzip, gzip, halt, head, hostname,
hwclock, id, ifconfig, init, insmod, ipcalc, kill, killall, klogd, ln, 
logger, login, logread, ls, lsmod,  makedevs,
md5sum, mesg, mkdir, mknod, more, mount, mv, nameif, nc, nslookup, 
passwd, pidof, ping, poweroff, printf, ps,
pwd, rdate, reboot, reset, rm, rmdir, route, sed, sh, sleep, sort, 
stty, sync, syslogd, tail, tar, test, time,
touch, tr, traceroute, true, tty, udhcpc, umount, uname, uniq, 
unix2dos, uptime, watchdog, wc, wget, which,
yes, zcat
  firewall#
 
-
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Re: ctrl-c doesn't work but ctrl-z is ok in telnet

2007-06-21 Thread Bin Chen
A little update for this problem, I wrote a propram to test the CTRL-C
signal, I found if I call:

signal(SIGINT, handler);

in main(), then the program can get the SIGINT when I press CTRL-C, but
if I comment out this line, the SIGINT can't cause the program exit.

I think this is caused by the default SIGINT processing logic inherited
from the busybox shell, right? In older busybox version we didn't
encounter this before, so maybe the reason is the default processing
logic for SIGINT in older busybox shell is exit.

Will a program started from shell inherit the signal processing
properties from the shell?

在 2007-06-21四的 10:31 +0200,Bernhard Fischer写道:
 On Thu, Jun 21, 2007 at 10:51:21AM +0800, Bin Chen wrote:
 
 I am using busybox-1.1 and I found the ctrl-c can't work when I
 telnet
 into the board, but ctrl-z can work.

 Any idea?
 
 Does it work with current trunk or at least 1.6.0?
 Did you read the FAQ (there is a ctrl-c entry)?

___
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox