Sponsored Content
Full Discussion: process check
Top Forums UNIX for Dummies Questions & Answers process check Post 75307 by vgersh99 on Thursday 16th of June 2005 04:03:48 PM
Old 06-16-2005
nope, not close yet - I recommended looking into "fuser"

let's call this script kas.sh

and let's invoke it as:
(./kas.sh &); sleep 2;./kas.sh
Code:
#!/bin/ksh
#

thisFILE="$(whence ${0})"
progName="${0##*/}"

     myPID="$$"

     FUSERout=$(fuser ${thisFILE} 2>/dev/null)
     typeset -i numProc=$(echo "${FUSERout}" | nawk '{print NF}')
     if [[ "${numProc}" -gt 1 ]]; then
        echo "${progName}: another instance(s) of [${thisFILE}] is currently sti
ll running [$(echo ${FUSERout} | sed -e 's/  */ /g')] - exiting THIS [${myPID}]run."
        exit 1
     fi

     sleep 5
     echo "finished->[${myPID}]"

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to check Process Utilisation

Hi, Is there any way in Unix to check for the system usage processwise ?? I mean I wud like to get a listing of running processes along with their CPU / memory utilisation so that I can spot dangerous the space / memory eaters .. Thanks & regards, SNS (2 Replies)
Discussion started by: Sabari Nath S
2 Replies

2. UNIX for Advanced & Expert Users

Check the process

I want to find the pid ( by ps ) that has already run over 30 seconds , I know ps only show the minute/hour . eg. the start time of the below process are 15:19 / 15:20 , but I don't know the exact time ( in term of "second" ) it start to run ( I only know the hour and minute ) , if I want to... (2 Replies)
Discussion started by: ust
2 Replies

3. Shell Programming and Scripting

check the process

how to kill the process that are idle over 30 minutes ? thx (2 Replies)
Discussion started by: ust
2 Replies

4. UNIX for Dummies Questions & Answers

Check the process

Except the command "top" , is there other function / tool is used to check the process status in the system like 1. what process are running ? 2. how the CPU are allocating ? 3. how many swap is using ? 4. " Thx. (1 Reply)
Discussion started by: ust
1 Replies

5. UNIX for Dummies Questions & Answers

Check whether a process is alive or not

Hi Everybody I have small requirement that needs to be implemented in shell script. Currently i have shell script which invokes a java process say "Process A" which runs in background. If some one tries to invoke again the same shell script , then there should be some mechanism inside the... (23 Replies)
Discussion started by: appleforme1415
23 Replies

6. Solaris

Check CRON Process

How to find what are the cron jobs which are running at any instant on a Solaris server ??? The job can be scheduled from any id but still would like to list all the cron jobs which are running on the server ??? (2 Replies)
Discussion started by: helper
2 Replies

7. Shell Programming and Scripting

Check process

Hi.. I have this code which tells me that if a process is running or not. Actually someone on this forum help me to do it. :) But now If i want to check if the process is not running for more than 10 minutes. Does anyone know the code or syntax that checks if a process is not running for some... (1 Reply)
Discussion started by: kanexxx
1 Replies

8. Shell Programming and Scripting

Check if Process is running

Hi , I have a csh code below which check the process if it's running. Can any expert advise me on the following: 1) what does this notationmean ">!" and how is it different from the append ">" notation ? 2) how does "setenv" work in this code ? # Check whether there is a running... (3 Replies)
Discussion started by: Raynon
3 Replies

9. UNIX and Linux Applications

How to check if process is running?

Hi I would like to check if an instance of a script is already running. I've seen many different examples, but I haven't the slightest idea as to how to do this. Can you please help. Thank you. (5 Replies)
Discussion started by: ladyAnne
5 Replies

10. UNIX for Dummies Questions & Answers

How a process can check if a particular process is running on different machine?

I have process1 running on one machine and generating some log file. Now another process which can be launched on any machine wants to know if process1 is running or not and also in case it is running it wants to stream the logs file generated by process1 on terminal from which process2 is... (2 Replies)
Discussion started by: saurabhnsit2001
2 Replies
KAS_UNLOCK(8)						       AFS Command Reference						     KAS_UNLOCK(8)

NAME
kas_unlock - Unlocks a locked user account SYNOPSIS
kas unlock -name <authentication ID> [-admin_username <admin principal to use for authentication>] [-password_for_admin <admin password>] [-cell <cell name>] [-servers <explicit list of authentication servers>+] [-noauth] [-help] kas u -na <authentication ID> [-a <admin principal to use for authentication>] [-p <admin password>] [-c <cell name>] [-s <explicit list of authentication servers>+] [-no] [-h] DESCRIPTION
The kas unlock command unlocks the Authentication Database entry named by the -name argument. An entry becomes locked when the user exceeds the limit on failed authentication attempts, generally by providing the wrong password to either an AFS-modified login utility or the klog command. Use the kas setfields command to set the limit and the lockout time, and the kas examine command to examine the settings. To unlock all locked user accounts at once, shutdown the kaserver process on every database server machine, and remove the /var/lib/openafs/local/kaauxdb file from each one. The kaserver process recreates the file as it restarts. OPTIONS
-name <authentication ID> Names the Authentication Database entry to unlock. -admin_username <admin principal> Specifies the user identity under which to authenticate with the Authentication Server for execution of the command. For more details, see kas(8). -password_for_admin <admin password> Specifies the password of the command's issuer. If it is omitted (as recommended), the kas command interpreter prompts for it and does not echo it visibly. For more details, see kas(8). -cell <cell name> Names the cell in which to run the command. For more details, see kas(8). -servers <authentication servers>+ Names each machine running an Authentication Server with which to establish a connection. For more details, see kas(8). -noauth Assigns the unprivileged identity "anonymous" to the issuer. For more details, see kas(8). -help Prints the online help for this command. All other valid options are ignored. EXAMPLES
In the following example, an administrator using the "admin" account unlocks the entry for "jones": % kas unlock -name jones -admin_username admin Administrator's (admin) Password: PRIVILEGE REQUIRED
The issuer must have the "ADMIN" flag set on his or her Authentication Database entry. SEE ALSO
kas(8), kas_examine(8), kas_setfields(8), klog(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 KAS_UNLOCK(8)
All times are GMT -4. The time now is 03:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy