08-23-2001
Yes, most signal handleing routines have some form of data structure that tells you the name of the sending process. The example data structure from linux (below) from the sigaction man page provides a glimpse into how this is done in one OS:
Quote:
The siginfo_t parameter to sa_sigaction is a struct with
the following elements
siginfo_t {
int si_signo; /* Signal number */
int si_errno; /* An errno value */
int si_code; /* Signal code */
pid_t si_pid; /* Sending process ID */
uid_t si_uid; /* Real user ID of sending process */
int si_status; /* Exit value or signal */
clock_t si_utime; /* User time consumed */
clock_t si_stime; /* System time consumed */
sigval_t si_value; /* Signal value */
int si_int; /* POSIX.1b signal */
void * si_ptr; /* POSIX.1b signal */
void * si_addr; /* Memory location which caused fault */
int si_band; /* Band event */
int si_fd; /* File descriptor */
}
10 More Discussions You Might Find Interesting
1. Programming
Hello,
I am working on Sun Solaris 5.7. I am trying to read the running time of a process through a C program.
One way I am reading it is by using the command ps -<pid> -f
The other way is from the struct psinfo_t which is there under /proc/pid/psinfo.
However, the two times are... (1 Reply)
Discussion started by: hmurali
1 Replies
2. Programming
I have written a program to collect some performance metrics on and AIX box, but I'm having difficultly getting the process information.
I'm lead to believe that I'm not getting the correct information because I'm trying to run the program on AIX 5.1 (5100-03), but I'm not convinced as the... (0 Replies)
Discussion started by: StuBob
0 Replies
3. Shell Programming and Scripting
I need a script to record top 5 processes to a file. I need the timestamp, cpu and memory utilization along with the process ID.
Thanks in advance! (1 Reply)
Discussion started by: jabcd
1 Replies
4. Shell Programming and Scripting
Hello,
We have a domain where instances attached to it are in multiple machines. Is there any way that I can get the process information of the domain of a secondary server from the primary.
ssh authentication is enabled on the functional ID and if I scsu to that ID and do the ssh: $ssh machine2... (0 Replies)
Discussion started by: chiru_h
0 Replies
5. UNIX for Dummies Questions & Answers
What sort of statistical information related to a running process can we retrieve using commands? For example, we can get the process id, memory usage and running time of a process using the commands ps and ipcs . Can we get any more information about a running process?
Please list them. Also... (4 Replies)
Discussion started by: fermisoft
4 Replies
6. Shell Programming and Scripting
Hello all
im trying to build small script in tcsh that will monitor some process
that are making some api calles to some server .
first of all im trying to find way to see how many threads each process is using , and else how can i print each
Thread id .
can it be done ? ( using sunOs ) (2 Replies)
Discussion started by: umen
2 Replies
7. Programming
Can any one tell me is there any problem in reading the /proc/#/status file for finding out the exact process name..??? (4 Replies)
Discussion started by: clintoo
4 Replies
8. Solaris
Hi All:-
1- i am working in unix system that is runnign some script
2- this script put the log file into specific folder
3- the log does not include the start time of the script and the end time
What i need to know what is the duration time for each request
Note:-
I don't any thing... (3 Replies)
Discussion started by: dellsh
3 Replies
9. Solaris
Hi Guys
Is it possible to display which process generates the most i/o on my zpool?
With # zpool iostst 3 and iostat i just see the general i/o but not the i/o on the process level.
thx in advance,
Fry (0 Replies)
Discussion started by: fryzh
0 Replies
10. Shell Programming and Scripting
I want to extract the process having highest utilization on each processor core
and then output its information (PID etc.) to a file. How can I do it by using either top or ps command?
Thanks. (1 Reply)
Discussion started by: Vaibhavs1985
1 Replies
esmd(1M) esmd(1M)
NAME
esmd - Essential Services Monitor (ESM) Daemon
SYNOPSIS
retry_seconds]
DESCRIPTION
The Essential Services Monitor (ESM) daemon, maintains the availability of essential system daemons by automatically restarting them if
they terminate. The ESM daemon monitors the Event Manager daemon, The ESM daemon is started by the init process when the system is ini-
tialized to run level 2 and continues to run until the system is shut down or returned to single user mode. Only one instance of can run
at a time.
Configuration information is sent to the ESM daemon by a control program, which is run at key points in the startup and shutdown proce-
dures. As startup or shutdown progresses, the control program updates the ESM state file, The control program then signals the daemon to
reconfigure itself.
On startup, state transitions occur after has started. On shutdown, transitions occur after each of these monitored daemons has termi-
nated. After each transition, the ESM daemon determines which of the monitored daemons should be running and adjusts its monitoring activ-
ities accordingly.
The ESM daemon reports all state change information, including notice of failures and restarts, through the system logging daemon, syslogd.
Messages are displayed on the system console during periods when syslogd is not running. See syslogd(1M) for more information.
If the ESM daemon fails to restart a monitored daemon, it reports the error by posting a high priority message through syslogd, and makes
no further restart attempts. The system administrator should investigate the problem and restart the failed daemon. The ESM daemon peri-
odically attempts to resume monitoring of the daemon, and posts an informational message when it succeeds. If the monitored daemon fails
again once monitoring has resumed, the ESM daemon again attempts to restart it.
The ESM daemon can be forced to restart a failed daemon by sending a SIGHUP signal to the process.
If there is a need to temporarily disable the ESM daemon for test purposes, in order to prevent the monitored daemons from being restarted
automatically, send a SIGSTOP signal to the process. To reactivate the ESM daemon, send a SIGCONT signal to the process. The ESM daemon
should never be disabled on a production system.
If the ESM daemon is terminated unexpectedly, it is restarted automatically by init.
Options
The command recognizes the following options:
Limit the priority of any syslog messages posted by the ESM daemon to "alert."
If this option is not specified, posts an "emergency" message if it cannot restart a failed daemon. A message may be sent to all
users currently logged in to the system. The option should only be used if the system administrator is actively monitoring syslogd
messages.
Specify the interval between attempts to begin monitoring a daemon
that has failed, and which has been unable to restart automatically. The default period is 30 seconds. Specifying a period of zero
disables retrying.
Notes
To use the start options, you must add them to the startup command in the file. The daemon reports any invalid start options with a single
generic message through syslogd.
Restrictions
The daemon terminates with an error message if it is started by any process other than init.
The /sbin/init.d/esm program is intended to be run by the system startup and shutdown process and should not be run from the command line.
Only one instance of can run at a time.
RETURN VALUE
The following exit values are returned:
0 (Zero) Successful completion.
not 0 An error occurred.
FILES
Executable file
Configuration control script
Initialization process control file
dispatched by boot init
Monitoring state file
Receives esmd status messages
AUTHOR
was developed by Hewlett Packard Company.
SEE ALSO
Commands
kill(1), evmd(1M), init(1M), syslogd(1M).
Files
inittab(4).
esmd(1M)