Operating System - HP-UX
1832655 Members
3173 Online
110043 Solutions
New Discussion

Removing the loop script which started by at command

 
SOLVED
Go to solution
susee_sundar
Regular Advisor

Removing the loop script which started by at command

Hi.,

I started a loop script which is running coninously in a time of 3 seconds...by the at command..

I dont know how to stop the script., When I try to kill the process since it is a loop command the process ID get changed immediately and I cant able to kill the process.

I deleted the script which the 'at' command used to start the loop., but it doesnt stop..

Regards
Suseendran ,A
8 REPLIES 8
Steven E. Protter
Exalted Contributor
Solution

Re: Removing the loop script which started by at command

Shalom,

Certain solution:
Stop the server, restart it, the script will no longer be running.

Other possibilities:
/sbin/init.d/cron stop

I know Linux has a separate daemon for cron, but I think HP-UX has not gone to that insanity yes. If cron is spawning it, this will help.

After stopping cron, you may need to kill the current version of the script.

This may not help, since the script is spawning itself every three seconds.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Yogeeraj_1
Honored Contributor

Re: Removing the loop script which started by at command

hi,

try to do:

1. at -l

2. at -r


kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Dennis Handly
Acclaimed Contributor

Re: Removing the loop script which started by at command

>I deleted the script which the 'at' command used to start the loop.

That should do it unless your script makes a copy of itself when it invokes at(1)? Or do you use at -f?

>SEP: If cron is spawning it, this will help. After stopping cron,

You might be able to suspend cron by using:
kill -STOP cron-pid

Then hunt down and clean up your script. Then resume by:
kill -CONT cron-pid
susee_sundar
Regular Advisor

Re: Removing the loop script which started by at command

Hi I killed the cron process by

kill -9 cron

now there is no more cron process running in my server., but stilll

[root@nibappsun07 /]$ ps -eaf | grep sleep
build 29854 4863 0 12:10:54 ? 0:00 sleep 5
build 29852 6664 0 12:10:53 ? 0:00 sleep 5
build 29850 4683 0 12:10:53 ? 0:00 sleep 3
[root@nibappsun07 /]$
[root@nibappsun07 /]$
[root@nibappsun07 /]$ ps -eaf | grep sleep
build 29854 4863 0 12:10:54 ? 0:00 sleep 5
build 29852 6664 0 12:10:53 ? 0:00 sleep 5
build 29858 4683 0 12:10:56 ? 0:00 sleep 3
root 29860 29655 0 12:10:56 pts/14 0:00 grep sleep
[root@nibappsun07 /]$ ps -eaf | grep sleep
build 29864 4863 0 12:10:59 ? 0:00 sleep 5
build 29862 6664 0 12:10:58 ? 0:00 sleep 5
build 29866 4683 0 12:10:59 ? 0:00 sleep 3
root 29868 29655 0 12:11:00 pts/14 0:00 grep sleep
[root@nibappsun07 /]$ ps -eaf | grep sleep
build 29883 4863 0 12:11:09 ? 0:00 sleep 5
build 29881 6664 0 12:11:08 ? 0:00 sleep 5
build 29879 4683 0 12:11:08 ? 0:00 sleep 3
root 29885 29655 0 12:11:10 pts/14 0:00 grep sleep
[root@nibappsun07 /]$


Still my process is running....
Dennis Handly
Acclaimed Contributor

Re: Removing the loop script which started by at command

>now there is no more cron process running in my server, but still my process is running.

I see 29854 twice, if you were fast, you could kill it. :-) Can you make sure cron didn't restart?

Why are there 3 "sleep"s? You might want to use the following to show the whole tree:
UNIX95= ps -Hfu build

If you are really using at(1), you could add "build" in /usr/lib/cron/at.deny.

You could try killing the parent process for sleep: 4863, 6664, 4683

You might want to do "ps -fp 4863 -p 6664 -p 4683" first, to see what they are.
susee_sundar
Regular Advisor

Re: Removing the loop script which started by at command

Hi Thanks to all..,,

Killing the parent process works...
Really happy to share my cheers with all..

Here is for a Glance
__________________________________________

[build@nibappsun07 build]$ kill -9 4863
[build@nibappsun07 build]$
[build@nibappsun07 build]$ ps -eaf |grep sleep
build 8476 1 0 13:39:16 ? 0:00 sleep 5
build 8478 6664 0 13:39:17 ? 0:00 sleep 5
build 8480 4683 0 13:39:17 ? 0:00 sleep 3
build 8482 8322 0 13:39:20 pts/12 0:00 grep sleep
[build@nibappsun07 build]$
[build@nibappsun07 build]$
[build@nibappsun07 build]$ kill -9 6664
[build@nibappsun07 build]$ ps -eaf |grep sleep
build 8505 1 0 13:39:37 ? 0:00 sleep 5
build 8509 8322 0 13:39:40 pts/12 0:00 grep sleep
build 8507 4683 0 13:39:38 ? 0:00 sleep 3
[build@nibappsun07 build]$ kill -9 4683
[build@nibappsun07 build]$
[build@nibappsun07 build]$
[build@nibappsun07 build]$ ps -eaf |grep sleep
[build@nibappsun07 build]$
[build@nibappsun07 build]$

_______________________________

Regards
Suseendran, A
Dennis Handly
Acclaimed Contributor

Re: Removing the loop script which started by at command

>Killing the parent process works...

I was really interested in seeing the whole tree. But it could be explained by a simple for/while loop with a sleep.
susee_sundar
Regular Advisor

Re: Removing the loop script which started by at command

Thanks to all