Sleep process not sleeping!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sleep process not sleeping!
# 1  
Old 10-31-2010
Sleep process not sleeping!

I had a script executing every hour to kill a process. I used loop rather than cron to execute it periodically. But now when I am trying to kill that sleep process of 1 hour its not getting killed. it is taking a new PID everytime I kill. To disable the script commenting is the only option left, cant I do it by killing the sleep process?
Script is:
Code:
while true
do
kill -9 `ps -eaf | grep AREmail | grep -v grep | awk '{print $2}'` 
sleep 3600
done

# 2  
Old 10-31-2010
Since you put it in a while true loop, it will faithfully do the destructive kill (-9) and fire off a new sleep (with a new pid). So the sleep was getting killed, but you need to kill the parent for all new sleeps to stop.
This User Gave Thanks to Scrutinizer For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (6 Replies)
Discussion started by: naveeng
6 Replies

2. UNIX for Advanced & Expert Users

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (1 Reply)
Discussion started by: naveeng
1 Replies

3. BSD

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (0 Replies)
Discussion started by: naveeng
0 Replies

4. Shell Programming and Scripting

Sleep 600 or fork/spawn a process or daemon?

Hi, I have a script that run every 10 minutes, from a specific timeframe of the day, for example 0500 - 1900. The script is some sort of checker script for an application log file and check for errors and email us if there is error/s reported in the log. At the moment, I schedule it... (1 Reply)
Discussion started by: newbie_01
1 Replies

5. UNIX for Dummies Questions & Answers

Sleep command not sleeping for specified time.

Hi, I have ascript with a recursive funtion below. I have mentioned to sleep for 60minutes but it doesnt doing so. Its keep on running until if /elif conditions satiesfies. Can you pls help what is wrong here. funcstatus () { if then echo "`date` - Current status... (2 Replies)
Discussion started by: gaddamja
2 Replies

6. UNIX for Dummies Questions & Answers

Process getting terminated after sleep iterations

Hello All, I have a script which has a functionality to sleep for 300 seconds after it does some processing, so in the logs if i check after the 3 iteration of sleep it didn't write saying "sleeping for 300 seconds". I suspect putty would automatically terminate session as i cannot access it any... (1 Reply)
Discussion started by: Ariean
1 Replies

7. Shell Programming and Scripting

Shell Scripting not showing in process when it goes to sleep

Hi All, Here is my script: sleep_time=`echo "9.6 * $num_servers"|bc| cut -d. -f1` if ; then sleep_time=3600;fi ### Allow the compare script to kick in after 1 hour at the least logger "Sleeping for $sleep_time seconds ...Will call compare.sh thereon" $act_log sleep $sleep_time #sleep... (3 Replies)
Discussion started by: ntgobinath
3 Replies

8. Shell Programming and Scripting

how to start a process and make it sleep for 5 mins and then kill that process

how to start a process and make it sleep for 5 mins and then kill that process (6 Replies)
Discussion started by: shrao
6 Replies

9. Shell Programming and Scripting

Unable to kill sleeping process

Hi, I'm trying to delete a sleeping process (parent ID is not 1) with "kill -9" command by the owner of the process (infodba) but it doesn't get killed. Is there any way of killing this process without killing the parent process or rebooting? (I'm using HP Unix B.11.11) $ ps -eflx | grep... (0 Replies)
Discussion started by: stevefox
0 Replies

10. UNIX for Advanced & Expert Users

my process is going to sleep mode after 12 hours but i need my process in in firsy pr

hi all I process is sleeping after 12 hours but i need to be run this to 24 hours but it goes in sleep mode after 12 hours what should i do to make process always running.Kindly give me suggestion. (0 Replies)
Discussion started by: mukesh_rakesh1
0 Replies
Login or Register to Ask a Question