Exec command timeout

386 views
Skip to first unread message

Anthony BRODARD

unread,
Jan 3, 2013, 9:59:13 AM1/3/13
to puppet...@googlegroups.com
Hi list,

I've writed this module to deploy the public key of our debian repository :

file
{
    "/etc/apt/repos-public.key":
        ensure  => present,
        mode => 440,
        owner => root,
        group => root,
        source => "puppet://puppet/apt/repos-public.key",
        notify => Exec[install-key];
}
exec
{
    "install-key":
        command => "/usr/bin/apt-key add /etc/apt/repos-public.key && /usr/bin/apt-get update",
        unless => "/usr/bin/apt-key list | /bin/grep 'Private Repos'",
}

So, it works fine, the key is correctly installed on all the nodes, but, randomly, during the compilation, the command isn't executed and lock the system during the timeout period (300s). It appear on all puppet compilation of the node, and the only way to resolve it is to reboot. This issue affect the nodes randomly, with an average of 1/month.

I've launch a manual compilation on a node actually impacted, with debug option, and I only have this error :

debug: /Stage[main]/Apt/Exec[install-key]: Executing check '/usr/bin/apt-key list | /bin/grep 'Private Repos''
debug: Executing '/usr/bin/apt-key list | /bin/grep 'Private Repos''
err: /Stage[main]/Apt/Exec[install-key]/unless: Check "/usr/bin/apt-key list | /bin/grep 'Private Repos'" exceeded timeout

If I try to exec the apt-key list command, it will works correctly :

[toad2]~ # time /usr/bin/apt-key list | /bin/grep 'Private Repos'
uid                  Private Repos (priv) <support@tld>

real 0.023      user 0.000      sys 0.000       pcpu 0.00

I don't see any error in the system log files.
Have you any idea about this issue ?

For information, puppetmaster and the clients runs on Debian Squeeze. Puppet version is 2.6.2 .

Thanks a lot !
Anthony
 

Matt Zagrabelny

unread,
Jan 3, 2013, 10:27:40 AM1/3/13
to puppet...@googlegroups.com
Note: I didn't follow this thread from the beginning, so this comment
might be out of place.
For our Squeeze installs, I perform the following:

class apt::config {
file { "/etc/apt/sources.list.d/umd.list":
source => "puppet:///modules/apt/etc/apt/sources.list.d/umd.list",
}
file { "/etc/apt/trusted.gpg.d/umd.gpg":
source => "puppet:///modules/apt/etc/apt/trusted.gpg.d/umd.gpg",
}
exec { "update_apt_for_new_sources":
command => "apt-get -q=2 update",
refreshonly => true,
subscribe => [
File["/etc/apt/sources.list.d/umd.list"],
File["/etc/apt/trusted.gpg.d/umd.gpg"],
],
}
}

Perhaps that will help.

-mz

Anthony BRODARD

unread,
Jan 3, 2013, 11:12:40 AM1/3/13
to puppet...@googlegroups.com
Hi Matt,

Thanks for your answer. I will try your module, it seems better that mine :)
But I don't think that the module is the problem, because it works fine on all the node. Just, I don't know why, it suddenly fail, and works again after reboot.

Anthony
Reply all
Reply to author
Forward
0 new messages