4

dirmngr is used by python-apt and is recommended by gnupg and gpgsm. I tried to shutdown dirmngr as shared in the manpage but got this -

└─[$] dirmngr -vv --shutdown

dirmngr[9494]: error opening '/home/shirish/.gnupg/dirmngr_ldapservers.conf': No such file or directory

Can somebody share how to shutdown it ? I tried --debug-level and other tricks but couldn't get it to shutdown. How do I shutdown dirmngr ?

Update -

[$] dpkg -l dirmngr

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                           Version              Architecture         Description
+++-==============================-====================-====================-=================================================================
ii  dirmngr                        2.1.17-3             amd64                GNU privacy guard - network certificate management service

Think it is installed perfectly inspite of the errors -

[$] systemctl --user status dirmngr

● dirmngr.service - GnuPG network certificate management daemon
   Loaded: loaded (/usr/lib/systemd/user/dirmngr.service; static; vendor preset: enabled)
   Active: active (running) since Sun 2017-01-08 14:46:21 IST; 5h 47min ago
     Docs: man:dirmngr(8)
 Main PID: 1203 (dirmngr)
   CGroup: /user.slice/user-1000.slice/[email protected]/dirmngr.service
           └─1203 /usr/bin/dirmngr --supervised

Jan 08 14:46:40 debian dirmngr[1203]: DBG: chan_5 <- KEYSERVER --clear hkp://pgp.mit.edu
Jan 08 14:46:40 debian dirmngr[1203]: DBG: chan_5 -> OK
Jan 08 14:46:40 debian dirmngr[1203]: DBG: chan_5 <- KS_GET -- 0xDAD95197
Jan 08 14:46:40 debian dirmngr[1203]: DBG: dns: libdns initialized
Jan 08 14:46:50 debian dirmngr[1203]: DBG: dns: getsrv(_hkp._tcp.pgp.mit.edu): Server indicated a failure
Jan 08 14:46:50 debian dirmngr[1203]: command 'KS_GET' failed: Server indicated a failure <Unspecified source>
Jan 08 14:46:50 debian dirmngr[1203]: DBG: chan_5 -> ERR 219 Server indicated a failure <Unspecified source>
Jan 08 14:46:50 debian dirmngr[1203]: DBG: chan_5 <- BYE
Jan 08 14:46:50 debian dirmngr[1203]: DBG: chan_5 -> OK closing connection
Jan 08 14:46:50 debian dirmngr[1203]: handler for fd 5 terminate  
shirish
  • 11,967
  • 27
  • 107
  • 190
  • Looking at the missing file error message, I'm mainly wondering if this daemon was run under the same user. – Julie Pelletier Jan 07 '17 at 19:33
  • I looked at the error, couldn't make a head or tail out of it. How do I find out the daemon bit that you are wondering about. – shirish Jan 07 '17 at 19:38

2 Answers2

11

With the current version of GnuPG you can kill dirmngr with gpgconf, like this:

gpgconf --kill dirmngr
sideshowbarker
  • 140
  • 1
  • 9
  • @shrish Did this actually fix the issue? – Jonathan Cross Jul 16 '17 at 13:09
  • Actually both commands work, now which one should I tick as the correct answer as both are correct/both work. The first one works much better as confirmed by `systemctl --user status dirmngr.socket` – shirish Oct 07 '17 at 12:47
  • You can use the systemctl one because that service actually called --kill dirmngr if you look at the content of the systemd service. So the accepted answer is better. – MaXi32 Sep 04 '21 at 11:13
3
systemctl --user stop dirmngr.socket
systemctl --user restart dirmngr.socket
Kenyon
  • 219
  • 2
  • 3