Re: Shell Script Help

2006-01-29 Thread Proniewski Patrick

On 29 janv. 06, at 16:10, Angelo Christou wrote:


list.txt contains:

bob home 9002
jim data 9005



Running the following for each line is what I'm trying to do:
myprogram bob home 9002
myprogram jim data 9005
and so on..


give this a try:

while read myline; do
   set -- $myline
   myprogram $1 $2 $3
done  list.txt



Patrick PRONIEWSKI
--
Administrateur Système - SENTIER - Université Lumière Lyon 2



Re: truss and procfs strange problem.

2006-01-27 Thread Proniewski Patrick

On 26 janv. 06, at 23:33, Dan Nelson wrote:


in that case, the command issued as a truss argument (ls, ...) is
stuck in state D. `man ps` says it Marks a process in disk (or
other short term, uninterruptible) wait.
these process wont be killed, I'll have to reboot. (procctl won't
clear the processes...)


You can continue tracing these processes if you run truss -p pid,
since that's pretty much what they're waiting for :)


you are right, thanks.

Apart from that, I've recompiled my system from 5.4p8 to 5.4p10, and  
the problem is still here...




Patrick PRONIEWSKI
--
Administrateur Système - SENTIER - Université Lumière Lyon 2

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


truss and procfs strange problem.

2006-01-26 Thread Proniewski Patrick

Hello,

I experience a strange problem with truss on FreeBSD 5.4 p8 :

$ truss ls
truss: cannot open /proc/4509/mem: No such file or directory
$ truss ls
truss: PIOCWAIT: Input/output error


of course, PROCFS is mounted :

$ df procfs
Filesystem 1K-blocks Used Avail Capacity  Mounted on
procfs 44 0   100%/proc


but, if I count `ls -1 /proc/ | wc -l` the result will always be limited
to 128, even if I have more than 200 lines in ps aux output :

$ ls -1 /proc/ | wc -l
 128
$ ps aux | wc  -l
 207

It really looks like a power of 2 limit, this is very strange.

The box is a PIV 3GHz, with HTT enabled  
(machdep.hyperthreading_allowed=1). Complete sysctl available at  
http://boleskine.patpro.net/~patpro/sysctl.txt, Kernel config below.


$ uname -a
FreeBSD my_box 5.4-RELEASE-p8 FreeBSD 5.4-RELEASE-p8 #0: Sun Oct 16
17:12:30 CEST 2005
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/PATPRO-20050829  i386

# egrep -v ^# /usr/src/sys/i386/conf/PATPRO-20050829

machine i386
cpu I686_CPU
ident   PATPRO-20050829

options SCHED_4BSD
options INET
options FFS
options SOFTUPDATES
options UFS_ACL
options UFS_DIRHASH
options MD_ROOT
options NFSCLIENT
options NFSSERVER
options NFS_ROOT
options MSDOSFS
options CD9660
options PROCFS
options PSEUDOFS
options GEOM_GPT
options COMPAT_43
options COMPAT_FREEBSD4
options SCSI_DELAY=15000
options KTRACE
options SYSVSHM
options SYSVMSG
options SYSVSEM
options _KPOSIX_PRIORITY_SCHEDULING
options KBD_INSTALL_CDEV
options AHC_REG_PRETTY_PRINT
options AHD_REG_PRETTY_PRINT
options ADAPTIVE_GIANT
options ALTQ
options ALTQ_CBQ
options ALTQ_RED
options ALTQ_RIO
options ALTQ_HFSC
options ALTQ_PRIQ
options ALTQ_NOPCC
options SMP
options MPTABLE_FORCE_HTT

device  apic
device  isa
device  eisa
device  pci
device  fdc
device  ata
device  atadisk
device  ataraid
device  atapicd
device  atapifd
device  atapist
options ATA_STATIC_ID
device  atkbdc
device  atkbd
device  psm
device  vga
device  splash
device  sc
device  agp
device  npx
device  pmtimer
device  sio
device  ppc
device  ppbus
device  ppi
device  em
device  miibus
device  fxp
device  ex
device  loop
device  mem
device  io
device  random
device  ether
device  tun
device  pty
device  md
device  bpf
device  uhci
device  ohci
device  ehci
device  usb
device  ugen
device  uhid
device  ukbd

Patrick PRONIEWSKI
--
Administrateur Système - SENTIER - Université Lumière Lyon 2

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: truss and procfs strange problem.

2006-01-26 Thread Proniewski Patrick

Hi,

On 26 janv. 06, at 18:13, Dan Nelson wrote:


$ truss ls
truss: cannot open /proc/4509/mem: No such file or directory
$ truss ls
truss: PIOCWAIT: Input/output error


The child process probably hasn't been fully started by the time the
parent tries to attach to it.  Adding a sleep(1) inside
setup_and_wait() in setup.c just before it tries to open /proc/%d/mem
is a quick hack that works.  A better solution would be to retry the
open and ioctl calls if they fail, after a short wait (but only doing
so for a couple seconds in case there was a problem starting the child
process).


hmmm I see. In fact, I have the cannot open error for a normal  
truss usage, and if I repeat the truss command very fast, I got the  
second error (PIOCWAIT: Input/output error). Slowing down the process  
is an interesting workaround :


truss ls - fails 100% of the time
ktrace truss ls - fail most of the time
truss `which ls` - works great.



I have no idea why the PIOCWAIT ioctl would fail like that


neither have I... In fact, the 128 items limitation of my procfs  
puzzles me even more.


thanks

Patrick PRONIEWSKI
--
Administrateur Système - SENTIER - Université Lumière Lyon 2

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: truss and procfs strange problem.

2006-01-26 Thread Proniewski Patrick

I have some new details :


$ truss ls
truss: cannot open /proc/4509/mem: No such file or directory



in that case, the command issued as a truss argument (ls, ...) is  
stuck in state D.
`man ps` says it Marks a process in disk (or other short term,  
uninterruptible) wait.


these process wont be killed, I'll have to reboot. (procctl won't  
clear the processes...)


Patrick PRONIEWSKI
--
Administrateur Système - SENTIER - Université Lumière Lyon 2

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]