02-03-2006
The situation is I have some processes that revert to uid 1 when they disconnect from the application. I can write a script that will awk out the uid, pid and time and kill anything that has reverted to uid 1. These hung processes also retain an application license until they die.
I know with the find command I can request a list of files over -mtime +n
I was just wondering if there was anyting that simple to tell me what process there are that are over "n" number of days old..
thanks!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I want to know my file is 1 hr 30 min old or not,
If 1 hr 30 min old I will do some tasks in that file.. other wise I will wait to 1 hr 30 min and then do the tasks.. how to do it in Unix script? any idea? (3 Replies)
Discussion started by: redlotus72
3 Replies
2. Shell Programming and Scripting
how to find the chid process id from given parent process id.... (the chid process doesnot have sub processes inturn) (3 Replies)
Discussion started by: guhas
3 Replies
3. HP-UX
Hi,
Can anyone help me out in writing the shell scrip which monitors a process which is running and gives me the output of the memory being used by the process, I have the requirement of monitorig the memory usage of the process when it is running.
Please help me out (3 Replies)
Discussion started by: vijayagiri
3 Replies
4. What is on Your Mind?
What is your age? (15 Replies)
Discussion started by: royal
15 Replies
5. Shell Programming and Scripting
KSH:
Please lt me know how to find the age of a file in minutes(Based on last modified time).
ie, if the file was modified 15 Minutes ago, the output should be 15 (1 Reply)
Discussion started by: hari_anj
1 Replies
6. Shell Programming and Scripting
I am trying to figure out how to look at only the following directory...
/lcl/prd/data/dc003p/dump
And search it for any files that have a .arc extension and are older then 24 hours.
I have never done anything like this and have no idea where to start. I want to make sure it does not... (10 Replies)
Discussion started by: LRoberts
10 Replies
7. Shell Programming and Scripting
I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time.
Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies
8. Shell Programming and Scripting
Hi
I can not say that i am new to perl but today i learned something new, i wanted to know age (last time file got modified) of file so i initially thought of using find -mtime command but when i googled it, i found perl solution for the same
my $age = -M $ARGV ;
print "$ARGV age is... (1 Reply)
Discussion started by: zedex
1 Replies
9. Programming
Hi:
I have a program written in FORTRAN running on AIX platform.
It is because missing of documentation and without root password, therefore we want to modify the program so that we can find out which script/program that call this FORTRAN program.
I have google for few days, all of them are... (3 Replies)
Discussion started by: cstsang
3 Replies
10. UNIX for Dummies Questions & Answers
I want a script that will identify all processes for a particular id and kill it if its running more than 5 hours.
i have tried to make it but dont know how to find to retrive the process running more than 5 hours.
tried below:
ps -eo pid,etime,comm,user,tty | grep sas
please help... (1 Reply)
Discussion started by: milan111
1 Replies
KILL(2) BSD System Calls Manual KILL(2)
NAME
kill -- send signal to a process
SYNOPSIS
#include <signal.h>
int
kill(pid_t pid, int sig);
DESCRIPTION
The kill() function sends the signal specified by sig to pid, a process or a group of processes. Typically, Sig will be one of the signals
specified in sigaction(2). A value of 0, however, will cause error checking to be performed (with no signal being sent). This can be used
to check the validity of pid.
For a process to have permission to send a signal to a process designated by pid, the real or effective user ID of the receiving process must
match that of the sending process or the user must have appropriate privileges (such as given by a set-user-ID program or the user is the
super-user). A single exception is the signal SIGCONT, which may always be sent to any descendant of the current process.
If pid is greater than zero:
Sig is sent to the process whose ID is equal to pid.
If pid is zero:
Sig is sent to all processes whose group ID is equal to the process group ID of the sender, and for which the process has permission;
this is a variant of killpg(2).
If pid is -1:
If the user has super-user privileges, the signal is sent to all processes excluding system processes and the process sending the
signal. If the user is not the super user, the signal is sent to all processes with the same uid as the user, excluding the process
sending the signal. No error is returned if any process could be signaled.
For compatibility with System V, if the process number is negative but not -1, the signal is sent to all processes whose process group ID is
equal to the absolute value of the process number. This is a variant of killpg(2).
RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
Kill() will fail and no signal will be sent if:
[EINVAL] Sig is not a valid, supported signal number.
[EPERM] The sending process is not the super-user and its effective user id does not match the effective user-id of the receiving
process. When signaling a process group, this error is returned if any members of the group could not be signaled.
[ESRCH] No process or process group can be found corresponding to that specified by pid.
[ESRCH] The process id was given as 0, but the sending process does not have a process group.
SEE ALSO
getpgrp(2), getpid(2), killpg(2), sigaction(2)
STANDARDS
The kill() function is expected to conform to IEEE Std 1003.1-1988 (``POSIX.1'').
4th Berkeley Distribution April 19, 1994 4th Berkeley Distribution