Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when trying to kill processes -- "kill: pid: arguments must be process or job IDs"

I'm trying to kill Sphinx on my server so that I can restart it. I tried using this command to find the PID:

ps ax | grep "searchd"

Which printed out this:

 1483 ?        S     00:00 /usr/local/bin/searchd --config /path/to/sphinx.conf
 1484 ?        Sl    20:51 /usr/local/bin/searchd --config /path/to/sphinx.conf
 1523 ?        S      0:00 /usr/local/bin/searchd --config /path/to/another/sphinx.conf
 1524 ?        Sl    20:35 /usr/local/bin/searchd --config /path/to/another/sphinx.conf
14174 pts/0    S+     0:00 grep searchd

I'm confused why there are duplicate entries and can't figure out what the S or Sl columns mean, but I tried this:

kill pid 1483
kill pid 1484

But that outputted this error:

-bash: kill: pid: arguments must be process or job IDs

When I list the processes again, it looks like it did kill the processes (I ran the kill command for the first two), but the error makes me wonder what I did wrong?

like image 497
Nate Avatar asked Aug 14 '14 21:08

Nate


1 Answers

It's

kill 1483
kill 1484

When you entered

kill pid 1483

What you said in effect was

Please kill the processes with number 'pid' and 1483.

The reference to pid in the message

-bash: kill: pid: arguments must be process or job IDs

is telling you the string 'pid' was not a valid process ID

like image 188
Jim Garrison Avatar answered Oct 24 '22 03:10

Jim Garrison