![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Identifying and grouping OS processes and APP processes | wilsonee | SUN Solaris | 2 | 09-30-2008 10:26 AM |
| Monitoring Processes - Killing hung processes | ukndoit | UNIX for Advanced & Expert Users | 4 | 01-17-2008 04:30 AM |
| Unable to kill sleeping process | stevefox | Shell Programming and Scripting | 0 | 10-30-2006 06:14 AM |
| sleeping less than a second | Perderabo | Answers to Frequently Asked Questions | 0 | 09-14-2006 03:06 AM |
| perl: sleeping during a command | effigy | Shell Programming and Scripting | 3 | 03-04-2005 09:04 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to wakeup sleeping processes
Hi,
Could someone please tell me how to wakeup sleeping processes? (i.e. change the process status from "S" to "R" when viewing in ps command). I ran a few programs in the background by "&" which went into "sleep" mode and I want them to run. Any help will be greatly appreciated. Steve |
|
||||
|
Quote:
fg %<name of process> eg fg %sort will bring the background process sort into the foreground |
|
||||
|
Thanks napolayan,
I tried by running the below in backgroud: Code:
$ sleep 180 & [1] 12059 $ ps -lfe | grep 12059 | grep -v grep 1 S infodba 12059 12043 0 168 24 517072c0 16 57021080 17:24:37 pts/tl 0:00 sleep 180 Code:
$ fg %1 Code:
$ ps -lfe | grep 12059 | grep -v grep 1 S infodba 12059 12043 0 168 24 517072c0 16 57021080 17:24:37 pts/tl 0:00 sleep 180 |
|
||||
|
fg and bg is not for making the process sleep and wake up... it is to make the process to go background and bring the process to back in case if it require any inputs...
if the process is sleeping, check whether there is any wait command in the script, check why it is waiting if there is any wait... don't think the process will go into sleep without any wait |
|
||||
|
Thanx mahendramahendr
Below is the program which I am running in the background: Code:
$ more testwait.ksh #!/bin/ksh n=20000 while [ $n -gt 0 ] do n=`expr $n - 1` done |
|
||||
|
add echo $n inside the while loop... and see where it goes into sleep state. I guess it shows as S even if your process is doing something... because I can see that the script is actually displaying the $n value in screen, still I see the state as "S"
Don't think it is a problem, echo $n should solve your doubt. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|