Sponsored Content
Top Forums Shell Programming and Scripting Watchdog for a specific process trigger another process Post 302867029 by liviusbr on Wednesday 23rd of October 2013 08:49:53 AM
Old 10-23-2013
Watchdog for a specific process trigger another process

Hi,

I am willing to build a script that does a "ps-ef" or "top" on a specific process, and if it finds it running to start another process.
Any suggestions to do this in a optimized way?

Thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check for specific process running through shell

Hi I want to check whether specific process is running or not through a shell script. ps -ef | grep will tell me this, i tried this way in shell cnt =`ps -ef| grep xyz | awk '{ END {print NR}}` if it return two rows, job is running else not. Is there any better way of doing this. (3 Replies)
Discussion started by: agp
3 Replies

2. Shell Programming and Scripting

Killing specific process

Hello, I need to create a process that will kill a specific process if it's running. Let's just say the process is called win, actually called something else. It could be running multiple times on the machine and I would want to kill them all. Below is the code I have written so far, and it... (6 Replies)
Discussion started by: benefactr
6 Replies

3. UNIX for Dummies Questions & Answers

getting unix stats for a specific process

Hi, We are trying to run reports to determine what percentage of the physical cpu's are being used by Informix ( oninit ) processes on an Aix5.3 box. Is there any way to do that ? Sar just captures percentages but not by process name Topas allows us to see some of the processes, but even those... (1 Reply)
Discussion started by: fwellers
1 Replies

4. UNIX for Dummies Questions & Answers

top output for a specific process to a file

Hi, I have the following script, and it is driving me nuts. It just hangs, I've tried all kinds of tricks, but it won't work. I know it can, it is pretty straight forward. It hangs when it tries to output $X Any help appreciated! #!/bin/bash set -o xtrace command="top -b"... (10 Replies)
Discussion started by: Bloke
10 Replies

5. Solaris

Watchdog for process

Hi, is there something build in solaris that can act as "watchdog". I have some process (service) running (e.g. Rhino). It can happen that if freezes totaly so I need to find this out and restart it totaly. My vision is two possibilities. 1) there is some counter running and I will... (2 Replies)
Discussion started by: freeangel
2 Replies

6. Shell Programming and Scripting

Script to kill the specific process

Hi I have the process to kill regulary, but the PSID is dymatic change and not sure how to kill the specific process ID Check the tradekast_rvd is running , if such process, kill the els process id ps -e f |grep tradekast_rvd ps -ef |grep els then I kill els process id ... (2 Replies)
Discussion started by: linux_user
2 Replies

7. Shell Programming and Scripting

ulimit -n for specific process

Hello all, I need to set the ulimit -n for a specific java process we are running. Can someone please verify my syntax. ulimit -n 10000 java com.Company.Application.Application.CustomJavaProcess & (2 Replies)
Discussion started by: jeffs42885
2 Replies

8. Shell Programming and Scripting

How to determine the completion of a background process to trigger something else?

I've been thinking about a peculiar problem, and so far haven't been able to find out a convincing solution to that. To put it simply, I have a shell script (assume it to be parent_script.sh), calling another shell script (child_script.sh) 5 times, in nohup mode to be executed in the background.... (3 Replies)
Discussion started by: Aviktheory11
3 Replies

9. UNIX for Dummies Questions & Answers

Grep a specific process name

Hello, I want to grep a specific process named "TEST" in AIX but not only is it showing what I want but also listing others that have the similar name. How can I only list "TEST"? I've tried using options grep -w with no change and grep -o isn't supported in my environment. Please advise. ... (6 Replies)
Discussion started by: seekryts15
6 Replies

10. UNIX for Beginners Questions & Answers

Pick file and Trigger informatica process

Hi, I am creating a script in which we will check a folder. If any file placed inside the folder, script will move the file to another folder and Trigger etl process. Now the issue is that the script should continously check the presence of file inside folder after every minute or hour. So how... (1 Reply)
Discussion started by: dgargd2524
1 Replies
PIDOF(8)						Linux System Administrator's Manual						  PIDOF(8)

NAME
pidof -- find the process ID of a running program. SYNOPSIS
pidof [-s] [-x] [-o omitpid] [-o omitpid..] program [program..] DESCRIPTION
Pidof finds the process id's (pids) of the named programs. It prints those id's on the standard output. This program is on some systems used in run-level change scripts, especially when the system has a System-V like rc structure. In that case these scripts are located in /etc/rc?.d, where ? is the runlevel. If the system has a start-stop-daemon (8) program that should be used instead. OPTIONS
-s Single shot - this instructs the program to only return one pid. -x Scripts too - this causes the program to also return process id's of shells running the named scripts. -o Tells pidof to omit processes with that process id. The special pid %PPID can be used to name the parent process of the pidof pro- gram, in other words the calling shell or shell script. NOTES
pidof is simply a (symbolic) link to the killall5 program, which should also be located in /sbin. When pidof is invoked with a full pathname to the program it should find the pid of, it is reasonably safe. Otherwise it is possible that it returns pids of running programs that happen to have the same name as the program you're after but are actually other programs. SEE ALSO
shutdown(8), init(8), halt(8), reboot(8) AUTHOR
Miquel van Smoorenburg, miquels@cistron.nl 01 Sep 1998 PIDOF(8)
All times are GMT -4. The time now is 07:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy