ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-users: Re: [Ethereal-users] Problem in putting tethereal to backroud job

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Thu, 20 Jun 2002 03:35:51 -0700
On Thu, Jun 20, 2002 at 01:16:15PM +0300, teuvo.g.eloranta@xxxxxxxxx wrote:
> [jihuu@box jihuu]$ tethereal -i eth0 -R giop &
> [1] 23033
> [jihuu@box jihuu]$ Capturing on eth0
>  
>  ( *** this goes to backround just fine... )

Does it actually capture any packets?  It may be that the only reason
you don't have any problems is that it doesn't capture and print any
packets....

> [jihuu@box jihuu]$ tethereal -i eth0 -R giop -w test.bin &
> [2] 23045
> [jihuu@box jihuu]$ Capturing on eth0
> 92  
> 
> ( *** the number of packets roll constantly in screen but the process
> is in backround, the shell prompt is mixed up )

(Note that the packet capture count Tethereal prints is a count of
packets that passed the capture filter, not a count of packets that
passed the read filter, so the fact that the count was printed does
*not* mean that Tethereal captured GIOP packets.

No, this is not an intentional feature.)

Background jobs in UNIX systems are, by default, allowed to write to the
terminal; you could set "tostop" with "stty", but then background jobs
would *stop* when they tried to write to the terminal, which is probably
also not what you want.

Try

	tethereal -q -i eth0 -R giop -w test.bin &

as the "-q" flag will cause Tethereal not to write the packet count to
the terminal.

> [jihuu@box jihuu]$ tethereal -i eth0 -R tcp &
> box jihuu]$ Capturing on eth0
>   0.000000 trdhcp104192.com -> box.com TCP 4390 > telnet [ACK] Seq=76852277 Ack=985911446 Win=7986 Len=0
>   0.000000 box.com -> trdhcp104192.com TELNET Telnet Data ...
>   aso...
> 
> ( *** does not go to backround, can't write anything to shell,
> cant stop the monitoring )

"Does not go to background" in what sense?

It writes stuff to the terminal, but, as I said, background jobs *can*
write to the terminal.  If it's continually writing stuff to the
terminal, that might make it *difficult* to type commands to the shell,
but it doesn't make it *impossible*.

If you want Tethereal to run in the background, use the "-w" flag, so it
doesn't print incoming packets to the terminal, and use the "-q" flag,
so it doesn't print a packet count to the terminal, or, if you want it
to print packets rather than saving them to a file, redirect its
standard output to a file so it doesn't go to the terminal.