LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 10-28-2018, 02:02 AM   #1
codywohlers
LQ Newbie
 
Registered: Apr 2009
Location: Alberta Canada
Distribution: KDE Neon
Posts: 10

Rep: Reputation: 0
Angry killall process not found


why can't `killall` find `gpg-agent` process?


Code:
codyw@cody-macbook:~$ ps -ef |grep gpg-agent
codyw      364   300  0 01:01 pts/4    00:00:00 grep --color gpg-agent
codyw    17519     1  0 00:36 ?        00:00:00 gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon

codyw@cody-macbook:~$ killall gpg-agent
gpg-agent: no process found
returned 1

codyw@cody-macbook:~$ ps -ef |grep gpg-agent
codyw      455   300  0 01:01 pts/4    00:00:00 grep --color gpg-agent
codyw    17519     1  0 00:36 ?        00:00:00 gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon
 
Old 10-28-2018, 06:33 AM   #2
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,791

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
A command might alter its arg0 that causes an inconsistancy in the naming.
Check different methods with
Code:
ps -e -o fname,cmd,comm,args
 
1 members found this post helpful.
Old 10-28-2018, 05:00 PM   #3
codywohlers
LQ Newbie
 
Registered: Apr 2009
Location: Alberta Canada
Distribution: KDE Neon
Posts: 10

Original Poster
Rep: Reputation: 0
hmmm...

Code:
codyw@cody-macbook:~$ ps -e -o fname,cmd,comm,args |grep gpg
grep     grep --color gpg            grep            grep --color gpg
gpg-agen gpg-agent --homedir /home/c gpg-agent       gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon
 
Old 10-28-2018, 07:27 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
What happens when you try this?

Code:
$ kill [process number]
 
1 members found this post helpful.
Old 10-28-2018, 07:45 PM   #5
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,791

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
Perhaps killall takes the method that corresponds to fname and apparently truncates to 8 characters?
Then it's
Code:
killall gpg-agen
 
1 members found this post helpful.
Old 10-28-2018, 08:50 PM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon

that is the entire process. is it not?

killall "gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon"
and you only got one, so killall is over kill.

pkill [program name]
https://linux.die.net/man/1/pkill
is another one.

Last edited by BW-userx; 10-28-2018 at 09:04 PM.
 
Old 10-28-2018, 08:57 PM   #7
codywohlers
LQ Newbie
 
Registered: Apr 2009
Location: Alberta Canada
Distribution: KDE Neon
Posts: 10

Original Poster
Rep: Reputation: 0
tried `killall gpg-agen` and it also says process not found. I can tab-complete after killall and get gpg-agent so it knows it's a process.

`kill [process num]` does work.



some info:

Code:
$ killall --version
killall (PSmisc) 23.1

$ lsb_release -sdc; uname -sri
KDE neon LTS User Edition 5.12
bionic
Linux 4.15.0-36-generic x86_64
 
Old 10-28-2018, 09:02 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Quote:
`kill [process num]` does work.
That leads me to theorize that there's something screwy with the process name as reported, but I have no idea what it might be.

Aside: Woo-Hoo. As a friend of mine once said, even a blind pig finds an acorn once and awhile.
 
Old 10-28-2018, 09:09 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by codywohlers View Post
tried `killall gpg-agen` and it also says process not found. I can tab-complete after killall and get gpg-agent so it knows it's a process.

`kill [process num]` does work.



some info:

Code:
$ killall --version
killall (PSmisc) 23.1

$ lsb_release -sdc; uname -sri
KDE neon LTS User Edition 5.12
bionic
Linux 4.15.0-36-generic x86_64
try
Code:
 ps -e -o fname,cmd,comm,args |grep gpg
to get the running one, then copy the entire line between quotes.
gpg-agent is not the process it is only part of it,
Code:
killall "gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon"
see what that tells ya.

Last edited by BW-userx; 10-28-2018 at 09:13 PM.
 
Old 10-29-2018, 06:59 PM   #10
codywohlers
LQ Newbie
 
Registered: Apr 2009
Location: Alberta Canada
Distribution: KDE Neon
Posts: 10

Original Poster
Rep: Reputation: 0
also tried with no avail:

Code:
codyw@cody-macbook:~$ ps -e -o fname,cmd,comm,args |grep gpg
gpg-agen gpg-agent --homedir /home/c gpg-agent       gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon
grep     grep --color gpg            grep            grep --color gpg

codyw@cody-macbook:~$ killall "gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon"
gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon: No such file or directory
returned 1

codyw@cody-macbook:~$ killall 'gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon'
gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon: No such file or directory
returned 1
I've only ever experienced this with gpg-agent
 
Old 10-30-2018, 02:30 PM   #11
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,791

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
Try pkill instead.
The good thing about pkill is that you can test with pgrep before.
You can augment with -f to search in args, or "-u user" to search for a specific user (process owner) only.
Examples with pgrep:
Code:
pgrep -f "gpg-agent --homedir /home/codyw/.gnupg --use-standard-socket --daemon"
pgrep pgp-agent
pgrep pgp-agen
pgrep -u $USER pgp-agent
Note that pgrep/pkill use regular expressions. E.g. the dot in .gnupg means any character (not just dot).
 
1 members found this post helpful.
Old 10-30-2018, 02:55 PM   #12
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
killall also has a regexp option:
Code:
-r, --regexp
              Interpret process name pattern as an extended regular expression
 
Old 11-09-2018, 05:52 AM   #13
codywohlers
LQ Newbie
 
Registered: Apr 2009
Location: Alberta Canada
Distribution: KDE Neon
Posts: 10

Original Poster
Rep: Reputation: 0
pkill does work. strange.

Code:
pkill gpg-agent
I also tried killall -r gpg-agent but that still does not work. I'll confirm this behavior on a stock vm and then I guess I'll file a bug with killall.
 
Old 11-09-2018, 12:25 PM   #14
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by codywohlers View Post
tried `killall gpg-agen` and it also says process not found. I can tab-complete after killall and get gpg-agent so it knows it's a process.
Tab complete only works because there's a file in your $PATH with that name.
It has nothing to do with whether or not it's running or is a process.

Last edited by scasey; 11-09-2018 at 12:30 PM.
 
Old 11-09-2018, 02:14 PM   #15
mltvsk1
LQ Newbie
 
Registered: Nov 2018
Posts: 9

Rep: Reputation: 0
Why do you need him so badly?
 
  


Reply

Tags
cli



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
how to process a file after a pattern is found wedtorque Linux - Newbie 5 06-16-2017 07:10 PM
LXer: How to kill a process in Linux - kill, killall, pkill, xkill LXer Syndicated Linux News 0 04-02-2013 12:01 PM
[SOLVED] sh: killall: command not found ted_chou12 Linux - Software 5 11-17-2011 10:06 PM
when a process cann't be terminated through kill/skill/pkill/killall... Osirix Linux - Software 9 07-18-2006 11:16 PM
killall process not working on AS 3.0 skiski Linux - Software 1 08-31-2004 01:11 AM

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

All times are GMT -5. The time now is 11:56 AM.

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