Re: logging the message regarding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 28, 2001 at 05:20:35PM +0000, John Levon wrote:
> On Sun, Oct 28, 2001 at 06:06:45PM +0100, Erik Mouw wrote:
> > man strace
> > man ptrace
> 
> this is not very helpful. the ptrace mechanism cannot capture all
> processes in the system.

Of course it can, just use "strace -f -F" (see manual page for details).

> (not without some special init code, anyway)

Just create a  special login shell:

  /bin/stracesh:
  #! /bin/sh
  exec strace -o /tmp/strace-${USER}-$$ -f -F -ff /bin/bash --login

And give the particular user /bin/stracesh as login shell in
/etc/passwd.

If you're only interested in process management system calls, you can
also add the flag "-e trace=process".

> As for the log file question - check the code for /proc/kmsg

"strace -o filename -f -F -ff" probably does everything you want.

Why reinvent a kernel logging policy when both the kernel mechanism and
the userland policy are already in place?

> > man setterm
> 
> does this use /proc/sys/kernel/printk btw ?

No, it uses an ioctl (it has been doing that since linux-1.0, AFAIK).


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty
of Information Technology and Systems, Delft University of Technology,
PO BOX 5031, 2600 GA Delft, The Netherlands  Phone: +31-15-2783635
Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux