473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to kill a process automatically?

Hi,

I want to kill a process at 5.00 p.m .

I tried using crontab.

In crontab i gave like this:-

17 00 * * * kill processid.(say 1234)

but it is not killing the process at that time?

how should i give in crontab?

I don't have root permission.

only sudoers permission i have.

How sholud i do this?

with regards

Archana
Dec 19 '07 #1
6 9340
First of all you must be sure you have rights to kill pid you want, i.e.: you can only kill pid you launched unless you are root.

Hi,

I want to kill a process at 5.00 p.m .

I tried using crontab.

In crontab i gave like this:-

17 00 * * * kill processid.(say 1234)

but it is not killing the process at that time?

how should i give in crontab?

I don't have root permission.

only sudoers permission i have.

How sholud i do this?

with regards

Archana
Dec 19 '07 #2
Motoma
3,237 Expert 2GB
You should probably put some sort of error logging on the cron line, perhaps redirecting both stderr and stdout to a file.

My initial thought is that the user cron is being run as doesn't have the kill program in its $PATH.

Hi,

I want to kill a process at 5.00 p.m .

I tried using crontab.

In crontab i gave like this:-

17 00 * * * kill processid.(say 1234)

but it is not killing the process at that time?

how should i give in crontab?

I don't have root permission.

only sudoers permission i have.

How sholud i do this?

with regards

Archana
Dec 19 '07 #3
You should probably put some sort of error logging on the cron line, perhaps redirecting both stderr and stdout to a file.

My initial thought is that the user cron is being run as doesn't have the kill program in its $PATH.
Hi,

can u explain a bit more about this ?



with regards
Archana
Dec 20 '07 #4
Motoma
3,237 Expert 2GB
Hi,

can u explain a bit more about this ?



with regards
Archana
The first part: tack on "> /var/log/cron.kill.log 2>>&1" (sans quotes) to the end of your cron script. This will redirect any errors to the file /var/log/cron.kill.log for you to analyze.

What I think is happening is that the cron script A) unable to find the "kill" program, B) the cron script does not have permissions to kill the job, or C) the cron job isn't getting the right PID.
Dec 20 '07 #5
The first part: tack on "> /var/log/cron.kill.log 2>>&1" (sans quotes) to the end of your cron script. This will redirect any errors to the file /var/log/cron.kill.log for you to analyze.

What I think is happening is that the cron script A) unable to find the "kill" program, B) the cron script does not have permissions to kill the job, or C) the cron job isn't getting the right PID.

Hi,

Do i have to include "> /var/log/cron.kill.log 2>>&1" in crontab file?
I tried doing that but it didn't kill the script?

i gave like this:-crontab -e

18 22 * * * kill processid.

I can't give sudo kill in crontab and i can't give password also.(I tried giving but didn't work)

process id is taken correctly.

I checked crin file in that it was given like ORPHAN (no passwd entry)

I don't have root permission.

what are the otherways so that i can stop process without root permissions?

with regards

Archana
Dec 21 '07 #6
Motoma
3,237 Expert 2GB
Do i have to include "> /var/log/cron.kill.log 2>>&1" in crontab file?
I tried doing that but it didn't kill the script?
Right, but what it will do is create a file in /var/log called cron.kill.log which will have your errors listed.

If that file does not exists, change it to your home directory.
Dec 21 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Bob Swerdlow | last post by:
My application starts up a number of processes for various purposes using: self.popen = popen2.Popen3("/usr/local/bin/python -O "myscript.py") and then shuts them down when appropriate with...
10
by: Fred | last post by:
There is a setting in INIT.ORA that has the unintended side-effect of making sure the ALTER SYSTEM KILL SESSION command has immediate affect. Without this setting, I've seen some instances where...
3
by: pattanawadee | last post by:
Deall All, Could anybody suggestion me How to kill all inherrit processes (sibling child,previous and parent process) in the case I know only child process id and user id, For example I strart...
6
by: Matthew Wieder | last post by:
What permissions must a user have to be able to succesffuly execute a Process.Kill? I can run it with Admin privleges but not with regular user priveleges - I get an "Access is Denied." The...
1
by: Manfred Braun | last post by:
Hi All, I am writing a tool, which should monitor some exe-processes, which are not very solid. Th main function is to re-start them, if they hung, but this is complicated. I can detect things...
0
by: WATYF | last post by:
This is my problem... I have some code that starts a Process and returns it to a variable... (prcBat) At any time while that process is running... I want to be able to Kill it by pressing a...
5
by: Dino Buljubasic | last post by:
My application can allow a user to open a file for viewing by fetching file data from database, creating the file in a temp directory and starting appropriate process (i.e. Adobe or any other...
4
by: Richard Rossel | last post by:
Hi Fellows, I have a problem with process termination. I have a python code that apache runs through a django interface. The code is very simple, first, it creates a process with the...
4
by: yxq | last post by:
Hello, I want to kill the Explorer process, after Explorer process has been killed, it will restart automatically immediately. How to disable it restart automatically? for example, in Windows Task...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.