General :: Pipe Kernel Messages To Another Process As They Occur
Apr 13, 2011
I have an OLED screen on my laptop that I have configured to show status information. The current driver I have installed in Linux for it is able to display messages by sending them to a script as an argument separated by spaces.Example: the command /opt/asusg50oled/utils/notify.sh Hi Everybody "Hello World" displays on the oled screen:
Hi
Everybody
Hello World
If another message is sent before the old ones disappear and it reverts to status info, it pushes off the top message. Example: less than 30 seconds after the previous example, /opt/asusg50oled/utils/notify.sh "Bananas have potassium" is executed:
Everybody
Hello World
Bananas have potassium
What I want to do is have kernel messages (the kind you see by running dmesg) forwarded to this script. For example, when I insert a USB drive, the following information would show on the OLED screen as they're logged:........
Looking through syslog, I see some peculiar messages that occur when booting my Debian machine up. Can anyone explain to me, why it seams to think my filesystem is read only, and what do the other messages mean? Is there anything I need to start worrying about?
Feb 26 08:48:21 chris-desktop kernel: [ 4.082355] EXT3-fs (sdb3): recovery required on readonly filesystem Feb 26 08:48:21 chris-desktop kernel: [ 4.082361] EXT3-fs (sdb3): write access will be enabled during recovery
We want to kill a process provided that only process name is given and we are to first find out the process id and then kill the process. Yes, in one go! That is, using pipe.
I'm trying to solve a kernel bug discussed in /show_bug.cgi?id=24002. One clue is that the problem does not occur when the kernel used by the installer for 11.4 is booted. Can any one tell me how to strip down the vanilla kernel to produce the installer kernel? Perhaps if I can strip down the vanilla kernel one step at a time then I can find the bug.
I am trying to automate some directory naming when we're manually running some scripts and are using tee to direct the output to a file (log). Right now this is what we do
Code:
./some_script.sh 2>&1 | tee /home/user/some_dir/logs/manual/some_script_20110216_1628.log
As a matter of laziness and keeping the log files consistently named, I'd like to create a function to pipe it to so that it's doing all the naming How I envision the command running
Code:
./some_script.sh 2>&1 | myfunc
And what the logfile name should look like (and in the right directory)
Code:
some_script_20110216-1628.log
I was thinking of adding a function to our profile to handle this. Just in testing I was trying to stream line right on the command line, but I'm having some difficulty in getting the name of the script that is pushing data over the pipe. Here is what I've tried
Code:
./some_script.sh 2>&1 | tee $(cd ../logs/manual; pwd)/$0_$(date +%Y%m%d)-$(date +%H%M).log
I need to debug a kernel panic. It prints some long log to the console, but even if i set 1920x1440 VESA framebuffer mode, i can't see it whole. So, i would like to direct all the kernel messages to a COM port and read them on another machine. Is there any way of doing so? What are the other (maybe better/easier/etc.) ways of catching whole kernel panic messages or scrolling the ones already displayed?
I've written a simple server in linux used fork to create a FIFO pipe.The server create two FIFO pipe.One for server read data from client and write data to client.Then another pipe for client read data from server and write data to server.When the server read data from a client used server-pipe and then write data to client.But ,if the client no read open the pipe,the server side write will be crashed because of a broken-pipe SIGPIPE. How to check whether the read side is opened?Or,how to catch the SIGPIPE,and then my server will still execute on,not crashed!!
How can we find out the Process ID of Kernel? Is kernel in itself not a process which is running and handling the overall system calls and program executions?
I'm trying to upgrad from kernel 2.6.32.9 to 2.6.34.3 and I'm having problems.The boot finished with that old gem "Kernel panic - not syncing: Attempting to kill init !"I suspect that it's something to do with my PATA IDE driver because there have been kernel changes in this area.My problem is all the boot messages scroll off the top of the screen before I can read them and it's no use saying look at dmesg or /var/log/messages because the root fs isn't there - another reason why I think it's to do with the drivers.So my question is, is there some way I can slow down the boot process so that I have a chance of reading the messages ?
I'm doing ping between 2 RH servers through a VPN site2site tunnel and in some times I got in the result pipe 2 and another pipe 3 as I mark it in blue color below.
e.g.
64 bytes from 192.168.1.10: icmp_seq=0 ttl=128 time=0.229 ms 64 bytes from 192.168.1.10: icmp_seq=1 ttl=128 time=0.287 ms 64 bytes from 192.168.1.10: icmp_seq=2 ttl=128 time=0.278 ms
[code]....
What's the difference between pipe 2 and pipe 3 and what's the meaning of it?
I have removed desktop manager from /etc/init, and GRUB is configured to use console. After upgrading from Karmic to Lucid I have noticed just before login invitation all previuos console output is cleaning. As a result I can not see boot process messages with Shift-PgUp/PgDown. How to prevent console output cleaning?
I have just purchased my first Linux PC - up to now I have always rolled my own so to speak. It is a little Dell Latitude 2100 which I got a good deal on through the outlet store - a refurb but it looks new. Ubuntu 9.04. It has built in wireless and I have gotten it to talk to my D-Link router although only with WEP and not yet WPA - that will come later.
When is the wireless connection supposed to occur? If I reboot the PC and watch for it to connect (using ping from another machine on the network) it does not appear until I login to it. It remains on the network after I logout(?) Is this normal? I am used to hard wired machines which come up on the network before a user logs in. Is there something I need to change in the network connection settings?
I got home today to find that my KDE login screen would not let me log in. It said the authentication process failed or something and I needed to terminate the screen lock process manually. So I go over to another virtual terminal and try to log in. As soon as I enter my user name, a bunch of errors come up and I am unable to log in. "This can't be good" I think to myself, and reboot.
I am greeted by this error upon booting: The error says that it says it cannot find /sbin/init. I loaded up a Ubuntu live CD and verified that /sbin/init is indeed present and all my other files still seem to be there. I tried booting into arch fallback on grub but that didn't work either. Midway through the day I SSHed my desktop from my phone and started it doing an upgrade. I was able to login.
I have a pool of approximately 1,000 Linux servers and I would like to get a total count of reboots that occurred on those servers each month. I would like to collect this reboot count at the end of each month. Can anyone tell me what the best way to get this count.
I installed a fresh copy of Slackware 13.1 (stable) on one of my media servers and I am experiencing something strange.... When I power up the machine, I see the kernel booting, no errors, until it gets to the point where it says:
And then randomly freeze there.... Well the machine is not totally frozen because the cursor still blinks. But it will never continue... Like I said, this happens on a random basis... After a reset, it might go through or simply stall at the same spot.
I remember after installing Slack 13.1, I rebooted the machine but forgot to remove the DVD from the player, so the install routine started up, and froze at the same point when it was loading the kernel for the setup programs...
My mobo is a MSI k9N platinum.
I never had this problem before.... (well I never used 13.1 before). Since I got this machine, I used slack 12.2 and slack 13-current with success.
This problem makes the machine extremely unreliable because I intent to use it as a backup and media server, so chances I will WOL the machine and use it remotely... if that happens.
I am currently struggling with one of my tasks.I was asked to find a way how to determine how much time an _already running_ process is spending in user and kernel space.E.G. <some tool> <pid>[Control] + [c]<pid> spent 12.1 seconds in user and 1.52 seconds in kernel space.Does something like this exist? Basically I guess I am looking for something similar to time, except that the process is already running.So..a) Is there a tool which fulfills this task?b) Is there a way to write your own software which does the job? Is it even possible to code something I am looking for?I recently found strace -c -p <pid>, but well, this is not exactly what I was looking for.
is there any way to disable kernel messages on the console? The problem I have is that it is almost impossible to work on the console due to a flood of file system errors from the kernel.
I've checked /etc/syslog.conf and disabled kernel logging to the console. Even with syslog turned off the messages still flood the console.
I have just installed Fedora 11 to my laptop and it appears I am in trouble. I have received two kernel failure messages, which I post below. What are the consequences of these issues and how can I solve them ?
When my computer shuts down, I always get a long error message from the kernel. It's the very last thing the computer does and I can't even use the keyboard, since the system is halted. I wanted to read it more carefully (it's very long and doesn't fit the screen) and file a bug report against the kernel with it. But for that, I needed to save all that text in a file.
Recently I am trying to install the latest Ubuntu / Xubuntu but after the kernel messages the display becomes corrupted. The machine is a Clevo laptop with the dreaded SIS 671 / 672 chipset. The Ubuntu 8.04 is working flawlessly. Any other version I get several problems and depending on the mood of the system I get a vertical running display ( not readable ) or a left horizontal displaced screen (readable) ...
I tried more tan several CDs ranging from 9.01 to 10.10 both Ubuntu or Xubuntu. What is the plainest (simpler ) VGA mode in order to install it? I have tried vga=normal and even VGA =3 with no success. With the latest Ubuntu 10.10 I get another problem it simply does not recognize the HDD / SSD. I have traced the SSD problem with the sata_sis module in kernel 2.6.35 and up... Other distros have the same problem ...
What i'm trying to accomplish seems rather silly but is needed for my little project here.
I'm using OpenSuSE 11.2 as a media center PC and need it to login automatically(console not X). That one i accomplished without problems.
However, after login i can see all the info about the services that were started and that needs to "go away".
One could do a "clear" in the .bash_rc and or .bash_profile but it will still show the login prompt which i don't want to see either (i don't even want to see the blinking cursor as well).
Question: How do i accomplish that so that the login console shows only the "splash screen" without any output of the kernel,rc.status nor the "issue-file"... just a plain blank screen ?