We get identical problem in our software installer. It seem that dirmngr
processes never goes away. We workaround the issue by terminating the
process manually:

{code}
=item addRepositories( @repositories )

 See iMSCP::DistPackageManager::Interface::addRepositories()
 
 Param list @repositories List of repositories, each represented as a hash with 
the following key/value pairs:
  repository         : APT repository in format 'uri suite [component1] 
[component2] [...]' 
  repository_key_srv : APT repository key server such as keyserver.ubuntu.com  
(not needed if repository_key_uri is provided)
  repository_key_id  : APT repository key identifier such as 5072E1F5 (not 
needed if repository_key_uri is provided)
  repository_key_uri : APT repository key URI such as 
https://packages.sury.org/php/apt.gpg (not needed if repository_key_id is 
provided)

=cut

sub addRepositories
{
    my ( $self, @repositories ) = @_;

    $self->{'eventManager'}->trigger( 'beforeAddDistributionRepositories', 
\@repositories ) == 0 or die(
        getMessageByType( 'error', { amount => 1, remove => TRUE } ) || 
'Unknown error'
    );

    # Make sure that repositories are not added twice
    $self->removeRepositories( @repositories );

    my $file = iMSCP::File->new( filename => $APT_SOURCES_LIST_FILE_PATH );
    my $fileContent = $file->getAsRef();

    # Add APT repositories
    for my $repository ( @repositories ) {
        ${ $fileContent } .= <<"EOF";

deb $repository->{'repository'}
deb-src $repository->{'repository'}
EOF
        # Hide "apt-key output should not be parsed (stdout is not a terminal)" 
warning that
        # is raised in newest apt-key versions. Our usage of apt-key is not 
dangerous (not parsing)
        local $ENV{'APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE'} = TRUE;

        if ( $repository->{'repository_key_srv'} && 
$repository->{'repository_key_id'} ) {
            # Add the repository key from the given key server
            my $rs = execute(
                [ 'apt-key', 'adv', '--recv-keys', '--keyserver', 
$repository->{'repository_key_srv'}, $repository->{'repository_key_id'} ],
                \my $stdout,
                \my $stderr
            );
            debug( $stdout ) if length $stdout;
            $rs == 0 or die( $stderr || 'Unknown error' );

            # Workaround 
https://bugs.launchpad.net/ubuntu/+source/gnupg2/+bug/1633754
            execute( [ 'pkill', '-TERM', 'dirmngr' ], \$stdout, \$stderr );
        } elsif ( $repository->{'repository_key_uri'} ) {
            # Add the repository key by fetching it first from the given URI
            my $keyFile = File::Temp->new();
            $keyFile->close();
            my $rs = execute(
                [ 'wget', '--prefer-family=IPv4', '--timeout=30', '-O', 
$keyFile, $repository->{'repository_key_uri'} ], \my $stdout, \my $stderr
            );
            debug( $stdout ) if length $stdout;
            $rs == 0 or die( $stderr || 'Unknown error' );

            $rs = execute( [ 'apt-key', 'add', $keyFile ], \$stdout, \$stderr );
            debug( $stdout ) if length $stdout;
            $rs == 0 or die( $stderr || 'Unknown error' );
        }
    }

    $file->save();

    $self->{'eventManager'}->trigger( 'afterAddDistributionRepositories', 
\@repositories ) == 0 or die(
        getMessageByType( 'error', { amount => 1, remove => TRUE } ) || 
'Unknown error'
    );
}
{code}

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/1633754

Title:
  dirmngr is used as daemon

Status in apt package in Ubuntu:
  Invalid
Status in gnupg2 package in Ubuntu:
  Confirmed

Bug description:
  I'm using Ubuntu 16.10 with gnupg2 2.1.15-1ubuntu6 and for example if
  I'm using apt-key to receive keys I'm noticing that dirmngr is started
  and kept open after the task is done. If apt-key is used multiple
  times even multiple times dirmngr is started while the old processes
  are still open.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1633754/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to