daemon help

Michael P. Reilly arcege at golem.usmsas.maine.edu
Thu Feb 7 06:27:00 AEST 1991


  Some systems allow a program to access kernal memory (through kmem and
possibly swap) for process information. The C routine would be nlist(3),
on SunOS, System V, and Ultrix at least. This returns the addresses (in
memory) of variables in the executable. Then you can lseek into /dev/kmem
to find the process table entry and look for the information there (you
may have to lseek into swap as well in the process is swapped out of memory.
The command nm(1), also on SunOS, System V and Ultrix, displays the symbol
table of the executable to help find which variable names to search for.
The system may have /dev/kmem and /dev/swap permissions set for no other
access, but since this is a daemon, root ownership would allow access.
I would suggest comparing values in the process table (for example, cpu-time,
priority, nice-value, etc.) to determine what the process is doing relative
to others and your desired values; also check the timing values of the process.
I hope this helps!
--Michael P. Reilly

+=======================================+=====================================+
|Michael Reilly				| Inter:   arcege at cs.usmsas.maine.edu |
|Unix Systems Admin/Analyst		| BITNet:  arcege at portland.bitnet     |
|Computer Science Dept.			|         ip60401 at portland.bitnet     |
|University of Southern Maine		| UUCP: (links temporarily down)      |
|96 Falmouth Street, Portland, ME 04103	| BellNet: (207) 780-4515	      |
+---------------------------------------+-------------------------------------+



More information about the Comp.unix.wizards mailing list