Ask Your Question
1

Error:: Failed to call refresh: No such file or directory - getcwd

asked 2013-08-28 15:25:45 -0600

shyp gravatar image

updated 2013-12-20 04:03:35 -0600

Stefan gravatar image

I updated my exec with refreshonly = true

and I am getting the error when it been notify when puppet run

Error:: Failed to call refresh: No such file or directory - getcwd

code :

jiji::package { 'api':
    notify => Class['api-post'],
}

class api-post {
    exec { "clean_tt" :
        command => "sudo rm -f  /etc/tt.xx ",
        path => "/usr/local/bin/:/usr/bin/:/bin/",
        refreshonly => true,
    }
}
edit retag flag offensive close merge delete

Comments

What uid is executing your Puppet manifests? If they are already running as root, you don't need to use sudo, and your exec will probably work as written. Also ...(more)

GregLarkin gravatar imageGregLarkin ( 2013-08-28 19:19:45 -0600 )edit

Hi , Thanks for your answer ! I didnt paste all the code but in general I want to delete the tt.xx file only when the jiji:packege is changing . I ...(more)

shyp gravatar imageshyp ( 2013-08-29 01:34:58 -0600 )edit

Unless you are running as non-root, you can likely remove sudo from the exec. Are you running on Linux with selinux enabled? It's possible that selinux needs to be ...(more)

GregLarkin gravatar imageGregLarkin ( 2013-08-29 08:31:48 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-12-20 03:31:53 -0600

ffrank gravatar image

If the above manifest (plus an include of the class) reproduces the error consistently, that may well be a bug.

In the context of a more complex manifest, I suspect you may be suffering the effects of dynamic scoping of resource defaults, such as

Exec { cwd => "/opt/will/not/exist" }

somewhere in the scope of the class. If the catalog is being cached, it will give you a clue about the precise characteristics of your resource.

You may want to try and work around the problem by specifying an explicit cwd parameter in the problematic exec.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2013-08-28 15:25:45 -0600

Seen: 1,026 times

Last updated: Dec 20 '13