Hi all,
I'm reading <advanced bash scripting> and there is a example to kill a background process in a limited time,as shown below:
I don't know why it use eval (is it necessary?)and i can't understand the meaning of
besides,the book says that /proc is where information about running process is found,but i can't find the relative directory of my background process.why?
I am having a problem getting the PID of a process I start in the background is a csh.
In tcsh and sh it's simple
$! give it to you
But in csh this just returns
Variable syntax
From the man page it should work but it doesn't????
Any help. (2 Replies)
hi,
i hav a query abt reading the contents of /proc/pid/maps file.is there any system apis or functions available to get the data from dat file and parse according to my need. i need name of the .so,Create date of the .so file.,Location of .so file etc.
please provide a good source.
yes i hav... (3 Replies)
Hi,
I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this.
Thanks in advance,
Amudha (7 Replies)
Dear all,
I'm writing a KornShell script that calls inside it a function in background mode
#!/bin/ksh
function myfunction
{ . . .}
myfunction |&
. . .
How can I capture the PID of the function myfunction that runs in background?
Thanks in advance
:) (2 Replies)
Guys,
can you help me in killing the process which is running in back ground under for loop
I am not able to find the PID using ps -afx|grep <word in command I entered> (1 Reply)
Hello. I was wondering if someone can help me out with something. To simplify my life, I have written a tiny script to open an ssh tunnel through another linux host so that I can access the esxi hosts on that network using the client. For this I have to tunnel ports 443, 902, and 903. Here is what... (1 Reply)
Hey all,
Okay, this one is tricky and I'm not sure there is a niec way to do it, or indeed anyway to do it. The main issue revolves around timing out a hung ssh. I am doing this by creating a wrapper script for the ssh with the following requirements.
My requirements are:
Defineable... (5 Replies)
Hi guys,
i need to write a shell script that will close file descriptors from /proc/pid/fd
will calling exec 4<&- solve the problem ?
thanks in advance :) (15 Replies)
I think the libc.so is shared between processes, because it is a shared library and OS is engaged for saving memory.
But, below, the maps of bash, shows r-xp and r--p rw-p attributes to libc.so which mean private memory space.
Can anybody explain this for me?
:)cat /proc/$$/maps... (4 Replies)
Hello All,
I was looking into creating a script that would be used only to start a Daemon and create a lock file...
F.Y.I. It's for Nagios' NRPE Daemon Plugin...
Anyway when I run the command to start the Daemon (below):
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
And... (14 Replies)
Discussion started by: mrm5102
14 Replies
LEARN ABOUT FREEBSD
timeout
TIMEOUT(1) BSD General Commands Manual TIMEOUT(1)NAME
timeout -- run a command with a time limit
SYNOPSIS
timeout [--signal sig | -s sig] [--preserve-status] [--kill-after time | -k time] [--foreground] <duration> <command> <args ...>
DESCRIPTION
timeout starts the command with its args. If command is still running after duration, it is killed. By default, SIGTERM. is sent.
--preserve-status Always exits with the same status as command even if it times out.
--foreground Do not propagate timeout to the command children.
-s sig, --signal sig Specify the signal to send on timeout. By default, SIGTERM. is sent.
-k time, --kill-after time Send a second kill signal if command is still running after time after the first signal was sent.
DURATION FORMAT
duration and time can be integer or decimal numbers. Values without unit symbols are interpreted as seconds.
Supported unit symbols are:
s seconds
m minutes
h hours
d days
EXIT STATUS
If the timeout was not reached, the exit status of command is returned.
If the timeout was reached and --preserve-status is set, the exit status of command is returned. If --preserve-status is not set, an exit
status of 124 is returned.
If command exits after receiving a signal, the exit status returned is the signal number plus 128.
If command is an invalid command, the exit status returned is 126.
If command is a non existing command, the exit status returned is 127.
If an invalid parameter is passed to -s or -k, the exit status return is 125.
SEE ALSO kill(1), signal(3)BSD Oct 28, 2014 BSD