LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-16-2021, 11:10 AM   #1
pigsfoot
LQ Newbie
 
Registered: Dec 2021
Posts: 9

Rep: Reputation: Disabled
Can i run a comand line in multiple sessions at once ?


Hi,

I have an RPI that has three wlan interfaces wlan0, wlan1 & wlan2. Each interface is set to a different channel.

When running on a single interface i us eteh following cmmand

PHP Code:
/usr/sbin/tcpdump  -----tt -i wlan0  type mgt  subtype probe-req 
What i woudl liek to do is run teh same command on all three interfaces.

I have read that i can use "-i any" but i get an error saying

Quote:
"tcpdump: any: That device doesn't support monitor mode"
I presume its referring to eth0 and lo interfaces.

I have also tried

/usr/sbin/tcpdump -l -I -n -e -tt -i wlan0 type mgt subtype probe-req & /usr/sbin/tcpdump -l -I -n -e -tt -i wlan1 type mgt subtype probe-req & /usr/sbin/tcpdump -l -I -n -e -tt -i wlan2 type mgt subtype probe-req

But it pretty much kills the RPI and i get undervoltage errors plus no packets are captures on any interfaces.

Is there a way around this, can the command be run in three seperate sessions using different interfaces in each? It's also worth mentioing that i run this command via a python file which is triggered by a custome service i wrote. All works fine with a single interface, i just want to add more.
 
Old 12-16-2021, 11:20 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,855

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
undervoltage means you must replace your power supply.
 
Old 12-16-2021, 11:44 AM   #3
pigsfoot
LQ Newbie
 
Registered: Dec 2021
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
undervoltage means you must replace your power supply.
Just like the button to mark as solved, if only there was one to say what does this have to do with my question!
 
Old 12-16-2021, 12:11 PM   #4
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,388

Rep: Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560
Quote:
Originally Posted by pigsfoot View Post
...kills the RPI and i get undervoltage errors plus no packets are captures on any interfaces.

Is there a way around this...
Quote:
Originally Posted by pan64 View Post
undervoltage means you must replace your power supply.
Quote:
Originally Posted by pigsfoot View Post
...what does this have to do with my question
Hmmm, you specificially mention when you try your RPI is killed due to undervoltage, and you ask if there is a way around it. He offers you solution for under-voltage error, apperantly it's a hardware problem. So your response doesn't make a lot of sense.
 
Old 12-16-2021, 12:47 PM   #5
pigsfoot
LQ Newbie
 
Registered: Dec 2021
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
undervoltage means you must replace your power supply.
Quote:
Originally Posted by enigma9o7 View Post
Hmmm, you specificially mention when you try your RPI is killed due to undervoltage, and you ask if there is a way around it. He offers you solution for under-voltage error, apperantly it's a hardware problem. So your response doesn't make a lot of sense.
Your absolutly right, its doesnt make any sense if you only post part of a sentance...

Quote:
Is there a way around this, can the command be run in three seperate sessions using different interfaces in each?
.. which bit of that reffers back to teh undervoltage...

Moving on... and back to teh original question please.... can the command be run in three seperate sessions using different interfaces in each?
 
Old 12-16-2021, 12:51 PM   #6
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,388

Rep: Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560
Quote:
Originally Posted by pigsfoot View Post
Your absolutly right, its doesnt make any sense if you only post part of a sentance...

.. which bit of that reffers back to teh undervoltage...
I quoted the part where you mentioned undervoltage already when you tried something. Look closely, it's there. It was your error report when you mentioned trying something, you get that error, and it kills your RPI. I quoted that part specifically because you acted confused.

Try with new power supply, do you still get that error? Does it still kill your RPI? Cuz obviously you can't do anything useful with dead RPI, so first things first.

Last edited by enigma9o7; 12-16-2021 at 12:53 PM.
 
Old 12-16-2021, 01:57 PM   #7
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by pigsfoot View Post
I have also tried

/usr/sbin/tcpdump -l -I -n -e -tt -i wlan0 type mgt subtype probe-req & /usr/sbin/tcpdump -l -I -n -e -tt -i wlan1 type mgt subtype probe-req & /usr/sbin/tcpdump -l -I -n -e -tt -i wlan2 type mgt subtype probe-req

But it pretty much kills the RPI and i get undervoltage errors plus no packets are captures on any interfaces.

Is there a way around this, can the command be run in three seperate sessions using different interfaces in each? It's also worth mentioing that i run this command via a python file which is triggered by a custome service i wrote. All works fine with a single interface, i just want to add more.
If that is run on one command line as it appears in the way it is posted then there is a problem with the & between the commands (backgrounding the first 2) but never noting the end of each command with a ; .

The comment about replacing the power supply is very germane to the issue since AFAIK a Pi only has one wifi interface by default and adding 2 more is additional hardware + additional power draw especially when they are constantly active as they would be when running tcpdump. The power supply is only capable of ~3 amps (~15 watts) if using the default power supply. The Pi itself told you it was under powered when you got the undervoltage errors.

Fix the power issue first since it can never be stable if it does not have adequate voltage/power to run properly.

As for your original question:
if you want those to run at the same time with only one terminal interface then change them to something like
Code:
/usr/sbin/tcpdump  -l -I -n -e -tt -i wlan0 type mgt  subtype probe-req  > somefile &
My system does not have 'type mgt', although it does have a type indicated by -T and none match mgt. It also does not have a subtype designation.

By directing the output of the command to a file you then can look at the file content to see what was captured and once in the background the command will run without filling up your screen. Three separate processes trying to use the screen at the same time will be a problem.

Last edited by computersavvy; 12-16-2021 at 02:13 PM.
 
Old 12-16-2021, 02:22 PM   #8
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
If that is run on one command line as it appears in the way it is posted then there is a problem with the & between the commands (backgrounding the first 2) but never noting the end of each command with a ; .
AFAICT, the OP wants them to be run in background. And ampersand (&) not only puts the command to background, it functions as a command delimiter as well: just as the semicolon (;) does. Another question is how useful it would be to run three tcpdump instances at once. Honestly, I don't know. That said, for that command line I'd rather use parallel as a shortcut:
Code:
seq 0 2|parallel tcpdump ... -i wlan{} ...
or
Code:
parallel tcpdump ... -i wlan{} ... ::: 0 1 2

@OP. Perhaps, kismet / kismet_drone would fare better than tcpdump in this situation?
 
Old 12-17-2021, 01:50 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,855

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
Quote:
Originally Posted by pigsfoot View Post
Your absolutly right, its doesnt make any sense if you only post part of a sentance...

.. which bit of that reffers back to teh undervoltage...

Moving on... and back to teh original question please.... can the command be run in three seperate sessions using different interfaces in each?
Yes, if you replace your PSU. That's all. Your command did not work because of a HW problem and any other command will/may fail the same way.
 
Old 12-19-2021, 06:02 PM   #10
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,405
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
You could use {} in bash or a for loop. But that might be to much delay between commands...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can i run a comand line in multiple sessions at once ? pigsfoot Linux - Newbie 1 12-16-2021 12:47 PM
A downloader to run under the comand line interpreter. stf92 Slackware 5 08-30-2017 11:41 PM
how to run test.jsp file in comand line interface on Linux ramesh14 Linux - Software 3 07-05-2011 09:02 AM
Multiple Autologins; Multiple Users; Multiple Sessions mrclisdue Linux - Desktop 1 09-26-2007 05:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration