Sponsored Content
Full Discussion: Track and kill the PIDS
Top Forums Shell Programming and Scripting Track and kill the PIDS Post 302355358 by trey85stang on Tuesday 22nd of September 2009 11:20:31 AM
Old 09-22-2009
here is a quick example that I use for stuff like this...

Code:
#!/bin/bash

ssh_fuction () {
  ssh $1 "my commands go here...." &
  return_code=$?
  sleep 300
  kill -9 $return_code
}

for servers in $somelist
do
  ssh_function $servers &
done

you can also add to the for loop a while loop so that you only run the command on x number of servers at time... etc...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Possible to track FTP user last login? Last and Finger don't track them.

Like the topic says, does anyone know if it is possible to check to see when an FTP only user has logged in? Because the shell is /bin/false and they are only using FTP to access the system doing a "finger" or "last" it says they have never logged in. Is there a way to see when ftp users log in... (1 Reply)
Discussion started by: LordJezo
1 Replies

2. Shell Programming and Scripting

comparing PIDs in shell..

Hi, There is a file having a list of running PIDs and another file having a list of registered PIDs. How can we check if the number of running PIDs are less or more than the registered PIDs, comparing the total no. in each and also each value. Request you to pls give your inputs. Thanks a... (2 Replies)
Discussion started by: marconi
2 Replies

3. Shell Programming and Scripting

How to track and later kill a process in a script

Hello, I am trying to write a script that turns off the screensaver for a certain period of time, then come back on. I have had it up and running for a while, but then I decided to refactor it a bit for my family members that are less computer savvy. I am starting a subshell for the "meat" of... (4 Replies)
Discussion started by: Narnie
4 Replies

4. Shell Programming and Scripting

differentiating PIDs under 200

Hey, So I'm new to shell scripting, and I'm trying to write one for my lab that will keep down the work load by deleting processes that are left over from previous sessions. Basically I want it to do three things. 1) Check the processes running 2) See if that person is logged on. 3) if... (2 Replies)
Discussion started by: prgoodwin
2 Replies

5. Solaris

Conflict with PIDs

I am trying to determine the root cause of a java process that dies trying to startup during it's cron job. I did go ahead and change the time that it starts up in the cron file and now it starts successfully. However is there a way to determine what PID a process was attempting to get when... (5 Replies)
Discussion started by: vedder191
5 Replies

6. Shell Programming and Scripting

Need help to kill pids

Hi there !!! I am writing a script to kill the pids on different linux boxes :cool: the output of my command gives the pids running on that box, but how can I kill all the pids without looping? :confused: Code: ssh $i ps -fu $USER | grep ManServer | grep -v grep | awk '{print $2}' | kill ... (4 Replies)
Discussion started by: prany_cool
4 Replies

7. Shell Programming and Scripting

Kill an specific process ID using the KILL and GREP commands

Good afternoon I need to KILL a process in a single command sentence, for example: kill -9 `ps -aef | grep 'CAL255.4ge' | grep -v grep | awk '{print $2}'` That sentence Kills the process ID corresponding to the program CAL255.4ge. However it is possible that the same program... (6 Replies)
Discussion started by: enriquegm82
6 Replies

8. Proxy Server

Samba kill the locked files from a useraccount by multiple smbd pids

Details Samba server: Release: 5.10 Kernel architecture: sun4u Application architecture: sparc Hardware provider: Sun_Microsystems Kernel version: SunOS 5.10 Generic_142909-17 Samba version: Samba version 3.5.6 Smb.conf file section Global: # smb.conf for Airbus Industries fuer... (0 Replies)
Discussion started by: Jean-Guillaume
0 Replies

9. Shell Programming and Scripting

Get all associated pids

im looking for a portable way to get the PID of the script that is running, and to get every other PIDs that are spawned from it. and by ever other PIDs, i presume, that would be "child processes". however, i want to shy away from using any command that is not available on every single unix... (1 Reply)
Discussion started by: SkySmart
1 Replies

10. UNIX for Beginners Questions & Answers

How to kill printer PIDs except the spooler PID?

First of all, I'd like to congratulate this big family and all members for all the work you do! I'm trying to do an script or sentence which kills an specific printers PIDs: all printers PIDs older than 72h running in the server. Steps: 1.- List all printers PID sorting by date: ps... (6 Replies)
Discussion started by: djflu
6 Replies
S390_STHYI(2)							System Calls Manual						     S390_STHYI(2)

NAME
s390_sthyi - emulate STHYI instruction SYNOPSIS
#include <asm/unistd.h> int s390_sthyi(unsigned long function_code, void *resp_buffer, uint64_t *return_code, unsigned long flags); DESCRIPTION
The s390_sthyi() system call emulates the STHYI (Store Hypervisor Information) instruction. It provides hardware resource information for the machine and its virtualization levels. This includes CPU type and capacity, as well as the machine model and other metrics. The function_code argument indicates which function to perform. The following code(s) are supported: 0 Return CP (Central Processor) and IFL (Integrated Facility for Linux) capacity information. The resp_buffer argument specifies the address of a response buffer. If the system call returns 0, the response buffer will be filled with CPU capacity information. Otherwise, the response buffer's content is unchanged. The return_code argument stores the return code of the STHYI instruction, using one of the following values: 0 Success. 4 Unsupported function code. For further details about return_code, function_code, and resp_buffer, see the reference given in NOTES. The flags argument is provided to allow for future extensions and currently must be set to 0. RETURN VALUE
On success (that is: emulation succeeded), the return value of s390_sthyi() matches the condition code of the STHYI instructions, which is a value in the range [0..3]. A return value of 0 indicates that CPU capacity information is stored in *resp_buffer. A return value of 3 indicates "unsupported function code" and the content of *resp_buffer is unchanged. The return values 1 and 2 are reserved. On error, -1 is returned, and errno is set appropriately. ERRORS
EFAULT The value specified in resp_buffer or return_code is not a valid address. EINVAL The value specified in flags is nonzero. ENOMEM Allocating memory for handling the CPU capacity information failed. EOPNOTSUPP The value specified in function_code is not valid. VERSIONS
This system call is available since Linux 4.15. CONFORMING TO
This Linux-specific system call is available only on the s390 architecture. NOTES
Glibc does not provide a wrapper for this system call, use syscall(2) to call it. For details of the STHYI instruction, see <https://www.ibm.com/support/knowledgecenter/SSB27U_6.3.0/com.ibm.zvm.v630.hcpb4/hcpb4sth.htm>. SEE ALSO
syscall(2) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux Programmer's Manual 2018-02-02 S390_STHYI(2)
All times are GMT -4. The time now is 09:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy