Jira (PUP-5801) exec resource may lose return code if command terminated

0 views
Skip to first unread message

James Stocks (JIRA)

unread,
Feb 2, 2016, 6:57:04 AM2/2/16
to puppe...@googlegroups.com
James Stocks created an issue
 
Puppet / Bug PUP-5801
exec resource may lose return code if command terminated
Issue Type: Bug Bug
Affects Versions: PUP 4.3.2
Assignee: Kylo Ginsberg
Components: Types and Providers
Created: 2016/02/02 3:56 AM
Environment:

el7

Priority: Normal Normal
Reporter: James Stocks

Reproduction:

  • Open 2 terminals to a host
  • In one terminal, run '/bin/sleep 100'
  • In the other terminal, after a couple of seconds find the pid of sleep and execute 'kill SIGALARM [pid]'
  • In the first terminal, echo $? to see the exit code - note that it is the number of seconds sleep had remaining before it was signalled.
  • Now repeat in Puppet, with a module like:

    class sleep {
      exec { 'sleep_a_while':
       command => '/bin/sleep 100',
      }
    }

  • Run Puppet with this module included, and while the catalog run is stuck on the sleep, signal SIGALARM to sleep as before

Expected:

  • The exec resource should fail because the returned value is [seconds remaining] and not 0

Actual:

  • The exec does fail, but it appears that the return value has been lost:

    Info: Using configured environment 'sleep'
    Info: Retrieving pluginfacts
    Info: Retrieving plugin
    Info: Caching catalog for ybbp6dpgky283nf.delivery.puppetlabs.net
    Info: Applying configuration version '1454413025'
    Error: /bin/sleep 300 returned  instead of one of [0]
    Error: /Stage[main]/Sleep/Exec[sleep_a_while]/returns: change from notrun to 0 failed: /bin/sleep 300 returned  instead of one of [0]

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc)
Atlassian logo

James Stocks (JIRA)

unread,
Feb 2, 2016, 6:58:03 AM2/2/16
to puppe...@googlegroups.com
James Stocks updated an issue
Change By: James Stocks
*Reproduction:*
 * Open 2 terminals to
 a  an agent  host
 * In one terminal, run '/bin/sleep 100'
 * In the other terminal, after a couple of seconds find the pid of sleep and execute 'kill SIGALARM \[pid\]'
 * In the first terminal, echo $? to see the exit code - note that it is the [number of seconds sleep had remaining before it was signalled|http://linux.die.net/man/3/sleep].
 * Now repeat in Puppet, with a module like:
{code}class sleep {

  exec { 'sleep_a_while':
   command => '/bin/sleep 100',
  }
}{code}
 * Run Puppet with this module included, and while the catalog run is stuck on the sleep, signal SIGALARM to sleep as before

*Expected:*
 * The exec resource should fail because the returned value is \[seconds remaining\] and not 0

*Actual:*
 * The exec does fail, but it appears that the return value has been lost:
{noformat}Info: Using configured environment 'sleep'

Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for ybbp6dpgky283nf.delivery.puppetlabs.net
Info: Applying configuration version '1454413025'
Error: /bin/sleep 300 returned  instead of one of [0]
Error: /Stage[main]/Sleep/Exec[sleep_a_while]/returns: change from notrun to 0 failed: /bin/sleep 300 returned  instead of one of [0]{noformat}

James Stocks (JIRA)

unread,
Feb 3, 2016, 7:32:04 AM2/3/16
to puppe...@googlegroups.com
James Stocks updated an issue
Change By: James Stocks
Scrum Team: Client Platform

Henrik Lindberg (JIRA)

unread,
May 16, 2017, 8:54:02 AM5/16/17
to puppe...@googlegroups.com
Henrik Lindberg assigned an issue to Unassigned
Change By: Henrik Lindberg
Assignee: Kylo Ginsberg
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
May 16, 2017, 8:56:02 AM5/16/17
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
May 16, 2017, 1:48:03 PM5/16/17
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 11, 2021, 1:05:02 AM6/11/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-5801
 
Re: exec resource may lose return code if command terminated

This issue hasn't seen any activity in a long time, and this situation seems fairly uncommon. I'm going to close for now. Please reopen if it is still an issue.

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages