Hi,
I am not completely new to linux.
My problem is the following:
The signal queue of my process gets filled with time.
With /proc/PID/status --> SigQ 6032/6032 i can see that the queue is full!
And my software is waiting on signals to process data. So I want to know wich signal filled my queue and I am interested to see the attached data of the signal --> sival_int or sival_ptr, I use sigwaitinfo() to read the data.
I want to write a Python script. In order to write it I need to figure out how to access the values associated with my signal level and bit rate.
If I use the following command
Code:
iwconfig | grep 'Signal level'
I get:
eth0 no wireless extensions.
lo no wireless extensions.
Link Quality=70/70 Signal level= -38 dBm
Obviously, I don't want Signal level. I want whatever it happens to be. In this case, it happens to be -38. Ditto Bit Rate...How do I grab -38 from the command line?
So, I'm new here. Was thrown into the deepend (read: shallow pool) of linux administration of a few centos 6.5 servers in October, and I've been pretty slow on the uptake. Years of Windows administration and desktop support will do that I guess.
So we have qmail on our prod servers that send out messages for our webapps. Postfix failed last night on a prod server, and it occurred to me that it's happened a few times since I've started, and instead of waiting for clients to tell us, I should be more proactive. I came up with/begged/borrowed/stole a quick script to check to see if postscript was running, and if it was, restart it, and contact us. This was to be run from jenkins.
Quote:
if (( $(ps -ef | grep -v grep | grep postfix | wc -l) > 0 ))
then echo 'Mail is up.'
else echo 'Mail is down! Attempting to restart service...'
service postfix restart
fi
The question was then raised about an unresponsive process (zombies!), and I figured it might be a better idea to use postqueue -q, or mailq to either see a Mailbox is empty, or look for fatal if postfix is off or unresponsive. This is where I ran out of coffee and went over the deep end.
To get this to work, I thought it would be a good idea to run two scripts. One to check if the mail queue is empty, and if not, send up a flag. The next was to run a few minutes later to check and see if the mail queue was throwing up a fatal error, and if it was, throw up a second flag, which sent out an email from jenkins. Incidentally, if the mailqueue were clogged, this would also trigger an alert. Our mailqueue doesn't get a lot of traffic.
First command. Returns then and else statement without issue.
Quote:
if ((mailq | grep 'empty') < 0 ); then echo 'Mail is up.'; else echo 'Mail queue is not empty. Please check mail server'; fi
Second one... Not so much.
Quote:
if (mailq | grep 'fatal') < 1; then echo 'Mail is up.'; else echo 'Mail queue is not empty. Please check mail server'; fi
You can probably suss out what I'm trying to do here, even though I'm not doing it right. Any ideas? I know this is newbie stuff, and I appreciate your taking the time to read this people.
One patch will add changes to some files, say
common/packet.h queue/priqueue.h queue/priqueue.cc
tcl/lib/ns-lib.tcl tcl/lib/ns-default.tcl tcl/lib/ns-packet.tcl .
And the next patch may undo those first changes,
and even add something that conflicts with
the functions intended in the first patch.
A few patches are meant to live together.
Or at least have no conflicts.
Most others not.
-
I don't konw above. Help me
Several of the apps are intermittently hanging and I am getting "Signal 11 error" messages. What is this error and what do I need to do about it?
Hello all, I currently have a very unreliable connection to the internet. I have a IPhone six that I was grandfather in on that has unlimited data and the personal hotspot feature on. I have bought many different modems, adapters..that is why I kept seeing this link pop up, (I was going to try and and even clone a ahhh "sheep" later). That is how desperate I am. I have rooms full of old hotspot devices. hardware, cords, routers, old phones, antennas, etc). I am currently just using wifi-over-wan on a CP-MBR95. As I am sure you all know this gives me barely enough bandwidth to download a Game of Thrones episode, and the signal fluctuates continually. In fact this is the second attempt at posting here because I lost the signal, and had to start over just as I had almost finished the last one, so I shall wrap it up. I would like any suggestions on what Linux version I should put on the awesome new hardware I received yesterday, and any suggestions on a bootloader would be great too. I am currently using Yosimite, but occasionally I need to play Skyrim or something so my head doesn't explode, or I wear out the reset button.
[B]Primarily[B], I need to first make sure I am at least getting enough bandwidth to justify my $180 a month Verizon bill (plus all the hardware I buy that never fits or works as expected, and ideally want be able to set up a VPN and share my data with friends. family, and community. I usually am quite impulsive, obsessive, and I do not often ask for help from others. That is most likely what has impeded my progress thus far. That and the fact the web can be loaded with poor information. I do not have any programming skills, but I have a strong imagination, and a willingness to learn. I also am devoted to aid the next curious soul who has the same fascination with getting in way over his head, and keeping at it until he at least knows more about something than he did if we spent his days with his head in the sand as sadly many of us do here in the US, especially the parts I'm from.
Thank you for suffering through that novice novella,
I look forward to learning what I can from you all.
Respectfully,
RaVen162
P.S. - I'm not sure how things work around here but if anyone has any suggestions at all, or have someway I can contribute, please don't hesitate to contact me. I got very close to losing my unlimited plan yesterday for upgrading to a 4g LTE phone on another line and putting the sim in the only plan with unlimited data. (if you ask questions like, "isn't that a violation of our contract by denying me the services I have paid for at an inflated cost for 8 years now." They usally say something like I'm not sure Sir. I'm not a lawyer..."OK can you put me in touch with him when he gets back from his deposition over at Tracfone"?.. got a call back 5 min later and he had no problems with what I did. By the way, just a heads up. I may me a smartass from time to time, but I am rarely one without the other. I apologize in advance for breaking any rules. Hopefully you guys will let me hang around for a bit. I really want to learn any OS I can, especially opensource ones. Thanks Again!
I am trying to process some .csv files with Linux as follows:
Some fields have data with newline characters embedded, like so:
"Bob Smith
531 Pennsylvania Avenue
Washington, DC"
(I verified the existence of the " via Wordpad. The file is too large to easily edit in Wordpad to get all the data for each row on a single line).
what linux command would I use on the files to get the data in each cell on one line?
I have tried:
1. awk -v RS="" '{gsub (/\n/,"")}1' file > newfile
but the cell data was still being read in as if "531 Pennsylvania Avenue" was a brand new row in the CSV file.
2. Command 1 followed by awk -v RS="" '{gsub (/\r/,"")}1' newfile > finalFile
but that resulted in all of the data in the file being put onto a single line.
3. awk -v RS="" '{gsub (/\r\n/,"")}1' file > newFile
But that result was the same as attempt number 2.
How can I preprocess the file so that:
"Bob Smith
531 Pennsylvania Avenue
Washington, DC"
is read as a single field on a single line as part of the row it should be associated with, like
"Bob Smith 531 Pennsylvania Avenue Washington, DC"
I'm currently reading Brian Wards book: How Linux Works: What Every Superuser Should Know 2nd edition and I'm confused about step 3 in the context of the other steps:
1. The CPU (the actual hardware) interrupts the current process based on an internal timer, switches into kernel mode, and hands control back to the kernel.
2. The kernel records the current state of the CPU and memory, which will be essential to resuming the process that was just interrupted.
3. The kernel performs any tasks that might have come up during the preceding time slice (such as collecting data from input and output, or I/O, operations).
4. The kernel is now ready to let another process run. The kernel analyzes the list of processes that are ready to run and chooses one.
5. The kernel prepares the memory for this new process, and then prepares the CPU.
6. The kernel tells the CPU how long the time slice for the new process will last.
7. The kernel switches the CPU into user mode and hands control of the CPU to the process.
What does he mean preceding time slice as surely the tasks have been completed during the time slice in steps 1-2?
Booted my computer with 2 USB flash drives inserted. One of the drives turned out to be an MS-DOS boot drive. The PC booted in DOS and wiped out the partition table of the other flash drive with my data on it. This second (64Gb) drive had a single 64Gb type 83 (Linux) primary partition (ext4 file system).
Is there a way to recover the data that's on the second stick?
I've been told that all I have to do is repartition it exactly as it was and my data will be there. But I'd like to have advice from the pros here before I start messing with it.
For the time being, I dd-ed the entire stick, as is, onto a blank partition of my hard disk (dd if=/dev/sdb of=/dev/sda14). The process completed without errors but /dev/sda14 is unmountable for the moment.
Thanks for any help.
Friends,
I'm completely a Linux newbie, so explain as much as possible.
I installed Linux Deepin on dual boot(practically, triple-boot).
When I select the Linux Deepin option in bootloader, I mostly get a blank screen for a long time.
After practically 2 mins, it presents with some lines of text which I, being a newbie to Linux can't comprehend and hence, cannot counter the error.
The lines go:
"
udevadm settle - timeout of 30 seconds reached, the event queue contains:
/sys/devices/pci0000:00:1d.7/usb1(1080)
/sys/devices/pci0000:00:1d.7/usb1.1-0:1-0(1081)
up waiting for root device. Common reasons for this problem:
root args(cat /proc/cmdline)
Check rootdelay = ...[There's something here I cannot recollect at the moment]
Missing modules(cat /proc/modules; ls /dev)
ALERT! /dev/disk/by-uuid/b4b672ea-c6e5-47fe-a174-165ffde63c8 doesn't exist!
Dropped to shell!
"
Then it goes to a Ubuntu shell or something of that sort.
Surprisingly, every-time I boot into Windows and then restart my desktop and then boot to Deepin, it successfully boots in.
I have Deepin installed on external hard disk which is not very fast(just mentioned this if it is of any use.) Also, my Windows is extremely slow in booting up, it takes almost 10 mins, which is why I switched to Deepin, which boots up almost in 2 mins if it does.
Any help would be extremely appreciated.