10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I want to save pid of a child process but I get empty file.
su myuser -c "nohup ./mydaemon.sh >/dev/null 2>&1 & print $! > mydaemon.pid"
This one works:
nohup ./mydaemon.sh >/dev/null 2>&1 & print $! > mydaemon.pid
Please help. Thank you in advance. (2 Replies)
Discussion started by: vincegata
2 Replies
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
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)
Discussion started by: RECrerar
5 Replies
4. Shell Programming and Scripting
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)
Discussion started by: numetheus
1 Replies
5. Shell Programming and Scripting
Hi,
I am using net::ftp for transferring files now i am trying in the same Linux server as a result ftp is very fast but if the server is other location (remote) then the file transferred will be time consuming.
So i want try putting FTP part as a background process. I am unaware how to do... (5 Replies)
Discussion started by: vanitham
5 Replies
6. Shell Programming and Scripting
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:
#! /bin/bash
#set -n
TIMEOUT=$1
count=0
hanging_jobs & {
while ((count < TIMEOUT));do
eval ' && ((count = TIMEOUT))'
((count++))
sleep 1... (6 Replies)
Discussion started by: homeboy
6 Replies
7. UNIX for Dummies Questions & Answers
What I need to learn is how to use a script that launches background processes, and then kills those processes as needed.
The script successfully launches the script. But how do I check to see if the job exists before I kill it?
I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies
8. Shell Programming and Scripting
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)
Discussion started by: mohan_xunil
1 Replies
9. Shell Programming and Scripting
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)
Discussion started by: dariyoosh
2 Replies
10. UNIX for Dummies Questions & Answers
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)
Discussion started by: samudha
7 Replies