LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-14-2007, 09:43 PM   #1
ashlyjay
Member
 
Registered: Dec 2006
Posts: 32

Rep: Reputation: 16
PID wont shutdown


gud day guys,

SLES 9.0 / FreeRadius

I read several manual documents for the FreeRadius. The command to kill a radius PID is

kill -9 (PID #) ---> this is manual

but I read the documentation to kill a radius instantly is

kill -9 'cat /var/run/radiusd/radiusd.pid' or
kill -1 'cat /var/run/radiusd/radiusd.pid'

and yet the system told me that "there is no such PID"
when I try to locate this file under /var/run/radiusd/radiusd.pid, the file was there, I even see my pid number in that file. Can someone help me if the command is wrong or can someone give me an alternative command on this one.
 
Old 03-14-2007, 10:36 PM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 30
The first two are wrong. The second two are better. See the difference?

Code:
kill -9 'cat /var/run/radiusd/radiusd.pid'
kill -1 'cat /var/run/radiusd/radiusd.pid'
kill -9 `cat /var/run/radiusd/radiusd.pid`
kill -1 `cat /var/run/radiusd/radiusd.pid`
 
Old 03-14-2007, 10:55 PM   #3
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
And, just to clarify a little (note my sig, below), the back-quote (on a US keyboard, at the left end of the top (numbers) row) is used to tell the shell to substitute the string returned by the command between the back-quotes into the string to be executed before executing it. I.e.: It means “Run this command and use its output here.” The single-quote (below the double-quote on a US keyboard) means “Use the text between the single-quotes literally.” So, to continue the example:
Code:
$ cat /var/run/xinetd.pid
2030
$ echo 'cat /var/run/xinetd.pid' # single quotes here
cat /var/run/xinetd.pid
$ echo `cat /var/run/xinetd.pid` # and with back-quotes
2030
 
Old 03-14-2007, 11:14 PM   #4
ashlyjay
Member
 
Registered: Dec 2006
Posts: 32

Original Poster
Rep: Reputation: 16
ok i get it now, I didnt notice this. Anyway, when I try to see my pid in /var/run/radiusd/radiusd.pid, there is 2348. but when I use in command shell "lsof -i :1812" the pid is different. This is why the PID wont shutdown. Do I have to add the PID number(when I use lsof -i :1812) in the /var/run/radiusd/radiusd.pid? but I think the PID number is random, is there a specific range for this???
 
Old 03-15-2007, 07:35 AM   #5
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 30
Quote:
Do I have to add the PID number(when I use lsof -i :1812) in the /var/run/radiusd/radiusd.pid?
I don't know the answer to that, but if you think lsof might be showing the correct pid, you could try this:

Code:
kill -9 `lsof -i :1812 | head -2 | tail -1 | awk '{print $2}'`
Hope this helps.
 
Old 03-15-2007, 11:27 AM   #6
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
You might also check to see if you have the pidof command in /sbin. If you do, there should be a man entry for it.
 
Old 03-15-2007, 02:05 PM   #7
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 960

Rep: Reputation: 35
i would recomend finding your PID with
ps -A
mabie with
ps -A | grep <process name>

then just
kill -9 PID
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kubuntu wont shutdown or reboot? Azalar Ubuntu 9 10-26-2009 09:51 PM
acidrip wont shutdow pc shutdown jeller Ubuntu 2 05-10-2006 03:12 PM
shutdown.pid kibuzo Linux - Software 16 06-04-2005 09:17 AM
when kill -9 PID wont work bleunuit Linux - Software 2 08-06-2004 12:46 PM
/var/run/[XXX].pid - Tcl pid code liguorir Linux - Software 1 05-20-2004 11:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration