05-10-2005
Pid still alive after "control C"
hi ,
i'm running 2 similar script (ksh) under AIX , the first go normally out when i type "control c" :
ps before :
notes01 19882 38990 0 11:54:48 pts/0 0:00 recover -s cla0bkpe -d /base/base01 -t May 05 23:02:17 2005 -v -f -a /base/base01/mail/mail-01/xxxx.nsf
notes01 30866 40880 0 11:53:24 pts/0 0:00 -ksh
notes01 38990 30866 0 11:53:55 pts/0 0:00 ksh /exploit/sun/notes/notes-recover
ps after => nothing
and the pid is killed when the 2nd got his pid alive :
ps before :
notes02 21492 49230 0 13:47:40 pts/0 0:00 nsrnotesrc -s pcyyesvg -ZZ -X -t May 03 23:00:26 2005 -d /base/base02 /base/base02/mail/mail-01/xxxx.nsf
notes02 39506 42214 0 11:20:11 pts/0 0:00 -ksh
notes02 49230 39506 1 13:47:11 pts/0 0:00 ksh /users/notes02/scripts/sad/util/notes_restaure.ksh
ps after :
notes02 21492 1 0 13:47:40 pts/0 0:00 nsrnotesrc -s pcyyesvg -ZZ -X -t May 03 23:00:26 2005 -d /base/base02 /base/base02/mail/mail-01/xxx.nsf
the first script extract:
..............
recover -s ${NWServ} -d ${Directory} -t "${NewDate}" -v -f -a ${Fichier} >> ${LOG} 2>&1 &
Pid=$!
x=0
while :
do
ps -u ${IDUSER} | grep -q "${Pid}"
[[ $? -ne 0 ]] && break
Result=$(ls -al ${Directory}/$(basename ${Fichier}) 2> /dev/null | awk '{print $5;}')
Result=$((${Result}*100/${Size}))
x=${x}+1
Sigle=$(print $((${x}%4+1)) | awk '{print substr("|/-\\",$1,1);}')
[[ ${TTY} -eq 0 ]] && (tput sc;printf "%s %s %%" ${Sigle} ${Result};tput rc)
sleep 1
done
..............
the second script extract:
.............
nsrnotesrc -s ${NWServ} -ZZ -X -t "${NewDate}" -d ${Directory} ${Fichier} >> ${LOG} 2>&1 &
Pid=$!
echo " PID"
echo $Pid
echo ""
x=0
while :
do
ps -u ${IDUSER} | grep -q "${Pid}"
[[ $? -ne 0 ]] && break
Result=$(ls -al ${Directory}${Fichier} 2> /dev/null | awk '{print $5;}')
Result=$((${Result}*100/${Size}))
x=${x}+1
Sigle=$(print $((${x}%4+1)) | awk '{print substr("|/-\\",$1,1);}')
[[ ${TTY} -eq 0 ]] && (tput sc;printf "%s %s %%" ${Sigle} ${Result};tput rc)
sleep 1
done
..........
Why in the second one , the script go out and the pid attached to the "1" father ?
Where is the mistake ?
thanks in advance
Christian
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
If I try to run "kill -14 pid", some processes in my application
get terminated , while some keeps running.
If SIGALRM signal is sent, they should make an exit.
What's the reason any process keeps on running. (1 Reply)
Discussion started by: poojac
1 Replies
2. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
3. UNIX for Advanced & Expert Users
Hi,
I mean Unix Linux general solution, so please don't move my question, as it's Unix specific.
I would like to remotely control my "full" Linux router.
Already succeeded to compile Linux Unix dialog, running some tests.
The issue is dialog comes with a limited number of widget boxes for... (4 Replies)
Discussion started by: jack2
4 Replies
4. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
5. 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
6. Tips and Tutorials
For the newbies, I should have posted this years ago....
Here is the standard (tiny) "bread and butter" perl script (on Linux) I use in my crontab files to insure key processes are alive ( just in case ! ) like httpd, named, sshd, etc.
The example below if for named......
... (1 Reply)
Discussion started by: Neo
1 Replies
7. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
8. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
9. AIX
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Discussion started by: penchev
3 Replies
LEARN ABOUT MINIX
suspend
suspend(1) User Commands suspend(1)
NAME
suspend - shell built-in function to halt the current shell
SYNOPSIS
sh
suspend
csh
suspend
ksh
suspend
DESCRIPTION
sh
Stops the execution of the current shell (but not if it is the login shell).
csh
Stop the shell in its tracks, much as if it had been sent a stop signal with ^Z. This is most often used to stop shells started by su.
ksh
Stops the execution of the current shell (but not if it is the login shell).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
csh(1), kill(1), ksh(1), sh(1), su(1M), attributes(5)
SunOS 5.10 15 Apr 1994 suspend(1)