Sponsored Content
Full Discussion: Restarting a Crashed Process
Top Forums Shell Programming and Scripting Restarting a Crashed Process Post 70705 by Just Ice on Tuesday 3rd of May 2005 08:05:34 AM
Old 05-03-2005
you could also ...

1. count the # of processes running and do nothing if all 10 are there
2. if less than 10 processes, identify which ones are not running and restart them

... if you have the monitor script sleeping and checking every second, your downtime per process will be quiet short ...

however, you might want to fix that hacker issue as soon as possible as anything you can do to fix your process --- they can break ...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

old server crashed

Hello We had an old system designed in fortran that ran on a IBM RS6000 AIX 3.2 system. The person who designed is long gone. It was replaced with a completely different (non unix) system 6 years ago. We still used it for historical lookups of older information. Well yesterday it died. The... (5 Replies)
Discussion started by: billfaith
5 Replies

2. AIX

AIX Crashed..

My AIX 5.3 Machine Carshed Can any one tell some way to find out what went wrong.. I mean debug why it got creahed... (3 Replies)
Discussion started by: pbsrinivas
3 Replies

3. Linux

system getting crashed

Hello, Iam a running a apache webserver in CentOS and i get a heavy traffic about 2.5 lac pageviews daily and my db size is about 2GB. Now the problem is after serving some lacs of requests by apache....Both apache and mysql hangouts and the system gets hanged up...using all resources in the... (2 Replies)
Discussion started by: dheeraj4uuu
2 Replies

4. Linux

Find out process that crashed the server

Hi everybody, I want to find out all the processes that ran before a server crashed. Is that possible? I've looked in /var/log/messages and found out that the system was out of memory. A user probably wrote a script (in Perl or Python) that used up all available memory and crashed the... (11 Replies)
Discussion started by: z1dane
11 Replies

5. Red Hat

Process does not dump any core files when crashed even if coredumpsize is unlimited

Hello Im using redhat and try to debug my application , its crashes and in strace I also see it has problems , but I can't see any core dump I configured all the limit ( im using .cshrc ) and it looks like this : cputime unlimited filesize unlimited datasize unlimited... (8 Replies)
Discussion started by: umen
8 Replies

6. Shell Programming and Scripting

Script for to kill the process Ids when restarting the unix server

Hi, I need a script to kill the process Ids for the user ABC. I prepared the following script after that while logging with user therough script i am not sure how to pass the user name and password.Can ou modify the script and help me out. #!/bin/bash for filesize in $(ls -ltr | grep... (4 Replies)
Discussion started by: victory
4 Replies

7. UNIX for Dummies Questions & Answers

Restarting a process

Hi, How is it possible to restart only your process. I can get the process killed but I am not able to start it. For eg : i first did this ps -ef|grep _out --displays all the process with _out in the name then I killed kill -15 36044 -- process id. Now how can i start the same... (1 Reply)
Discussion started by: TH3M0Nk
1 Replies

8. Solaris

System got crashed.

Hi Admins, In my local Vmware system i have installed solaris but while getting my root disk mirrored in svm I changed the vfstab entries and rebooted the server , the server got crashed, and now the root file systems and other filesystems are crashed. Please help me in recovering this. (2 Replies)
Discussion started by: Laxxi
2 Replies

9. Shell Programming and Scripting

Need help in restarting process

Hi friends, I have one unix command which is used to check the network status manually. followig is the command check_Network this command give follwoing status Network 1 is ok Network 2 is ok network 3 is ok network 4 is ok . . . . Network 10 is... (8 Replies)
Discussion started by: Nakul_sh
8 Replies

10. Red Hat

Process with S state(Interruptable) in RHEL and gives Advertise error after restarting/Killing the p

Hello, In our Production system one process is in S state(interruptible)and after killing and restarting the process gives 'advertise error'. This error goes after rebooting the Server. I have RHEL 5.9 (tikanga) OS in our server. We tried debugging the issue with the help of 'strace' command... (9 Replies)
Discussion started by: Rohits
9 Replies
sg_get_process_stats(3) 				     Library Functions Manual					   sg_get_process_stats(3)

NAME
sg_get_process_stats, sg_get_process_count, sg_process_compare_name, sg_process_compare_pid, sg_process_compare_uid, sg_process_com- pare_gid, sg_process_compare_size, sg_process_compare_res, sg_process_compare_cpu, sg_process_compare_time - get process statistics SYNOPSIS
#include <statgrab.h> sg_process_stats *sg_get_process_stats(int *entries); sg_process_count *sg_get_process_count(void); int sg_process_compare_name(const void *va, const void *vb); int sg_process_compare_pid(const void *va, const void *vb); int sg_process_compare_uid(const void *va, const void *vb); int sg_process_compare_gid(const void *va, const void *vb); int sg_process_compare_size(const void *va, const void *vb); int sg_process_compare_res(const void *va, const void *vb); int sg_process_compare_cpu(const void *va, const void *vb); int sg_process_compare_time(const void *va, const void *vb); DESCRIPTION
The sg_get_process_stats takes a pointer to an int, entries, which is filled with the number of processes the snapshot contains. The return value is a pointer to the first member of an array of sg_process_stats structures; the number of entries in the array is returned in entries. sg_get_process_count returns a pointer to a static buffer of type sg_process_count. These two functions provide information on the process running on the system. In the first case lots of detail is provided, and in the sec- ond case a summary of the states of the current processes. sg_process_compare_name sg_process_compare_pid sg_process_compare_uid sg_process_compare_gid sg_process_compare_size sg_process_compare_res sg_process_compare_cpu sg_process_compare_time These functions compare two sg_process_stats entries, and return an int to represent which one is greater. The main use of these functions is to be passed to qsort to sort the sg_process_stats by the given type. For example: qsort(sg_process_stats ps, int ps_size, sizeof *ps, sg_process_compare_pid); RETURN VALUES
The structure returned by sg_get_process_stats is of type sg_process_stats. typedef struct { char *process_name; char *proctitle; pid_t pid; pid_t parent; /* Parent pid */ pid_t pgid; /* process id of process group leader */ uid_t uid; uid_t euid; gid_t gid; gid_t egid; unsigned long long proc_size; /* in bytes */ unsigned long long proc_resident; /* in bytes */ time_t time_spent; /* time running in seconds */ double cpu_percent; int nice; sg_process_state state; } sg_process_stats; typedef enum { SG_PROCESS_STATE_RUNNING, SG_PROCESS_STATE_SLEEPING, SG_PROCESS_STATE_STOPPED, SG_PROCESS_STATE_ZOMBIE, SG_PROCESS_STATE_UNKNOWN } sg_process_state; process_name The name of the command that was run. proctitle The command line (the "title") of the process. Take note - this can be modified by the process, so isn't guaranteed to be the origi- nal command line. pid The process ID. parent The parent process ID. pgid The process ID of the process group leader. uid The UID the process is running as. euid The effective UID the process is running as. gid The GID the process is running as. egid The effective GID the process is running as. proc_size The size of the process in bytes. proc_resident The size of the process that's resident in memory. time_spent The number of seconds the process has been running. cpu_percent The current percentage of CPU the process is using. nice The nice value of the process. state The current state of the process. See sg_process_state for permitted values. The structure returned by sg_get_process_count is of type sg_process_count. typedef struct{ int total; int running; int sleeping; int stopped; int zombie; }sg_process_count; total The total number of processes. running The number of running processes. sleeping The number of sleeping processes. stopped The number of stopped processes. zombie The number of zombie processes. SEE ALSO
statgrab(3) WEBSITE
http://www.i-scream.org/libstatgrab/ i-scream $Date: 2005/04/25 11:25:45 $ sg_get_process_stats(3)
All times are GMT -4. The time now is 11:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy