LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-10-2008, 11:51 PM   #1
geek_man
Member
 
Registered: Nov 2007
Distribution: Fedora 7, Fedora 9, Solaris 10, Mac OS X, RHEL5
Posts: 71

Rep: Reputation: 15
Angry Can't kill application with cron


Hi!

I have a script that gets the PID of Exaile and kills it. It works well, but when I try to execute this script with cron it doesn't work. My cron is working fine, because in the script I included an echo to a file, just to see if it was working with cron, and it does the echo.

Is it because you can't kill applications with cron?

I am using Fedora 9.

Thanks.
 
Old 08-11-2008, 12:08 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
There is no such restriction in cron. Standard permissions apply.

Which user / group is the process running under?

Which user's crontab tries to kill the process above?
 
Old 08-11-2008, 10:00 AM   #3
geek_man
Member
 
Registered: Nov 2007
Distribution: Fedora 7, Fedora 9, Solaris 10, Mac OS X, RHEL5
Posts: 71

Original Poster
Rep: Reputation: 15
Cron problem

Hi!

The user who is executing the cron is my personal user, not root. The
crontab is the one of my user.
The problem is that it can execute any other command but the kill.

Thanks.
 
Old 08-11-2008, 10:06 AM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
And what does ps show for the process' UID and GID?
 
Old 08-11-2008, 10:43 AM   #5
geek_man
Member
 
Registered: Nov 2007
Distribution: Fedora 7, Fedora 9, Solaris 10, Mac OS X, RHEL5
Posts: 71

Original Poster
Rep: Reputation: 15
Cron problem

Hi!

$ ps -ef | grep exaile

Shows the same PID as top, I did not check the UID and GID, as soon as I get home, I will check it. The problem here is that if I execute the script from the terminal it kills exaile, but when cron executes the script it does not work.

I was wondering if SELinux could be the problem.

Thanks.
 
Old 08-11-2008, 01:21 PM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
What do your logs indicate when it attempts to run the kill script? Are you specifying the full path to the kill command in this script, usually it's a PATH issue when it comes to cron problems? My other question is, why do you need a cron job to kill a PID?
 
Old 08-12-2008, 12:53 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
Show us the script/cmd in cron.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
force kill application ahmad19 Linux - Newbie 3 04-08-2008 01:33 PM
How to kill a process or application vitalstrike82 SUSE / openSUSE 1 02-16-2008 10:23 AM
Cron.daily sends me a logrotate Kill usage message. pollardd Linux - General 1 09-02-2005 12:18 PM
kill procesed application fireedo SUSE / openSUSE 4 05-10-2005 11:24 AM
kill and detect spesific application melinda_sayang Programming 5 05-23-2004 03:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration