Issue #9134 has been updated by Stefan Schulte.

Before puppet executes the command it tries to resolve the executable. This 
will happen in two ways:

* you specify a full qualified path (I always prefer this one)
* you specify an array of directories puppet will search. You can do this by 
passing the `path` parameter. (In addition the `path` parameter also defines 
the environment variable `PATH` your external script may rely on)

If puppet doesnt find the executable it will refuse to run. However if you do 
one of the above and the resolve works, puppet will switch the current working 
directory before the actual execution of the command.

One can now argue that puppet should always put the `cwd` parameter in the 
array of searched directories.

In general I suggest to never use relative paths as a command parameter.
----------------------------------------
Bug #9134: Exec cwd does not work
https://projects.puppetlabs.com/issues/9134

Author: James Martin
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.7.1
Keywords: 
Branch: 


When I have a cwd specified it is ignored:

        cpfusion-glassfish-setup:
            user        => glassfish,
            cwd         => "/opt/glassfish",
            command     => "./lib/ant/bin/ant -f setup-cluster.xml 
${setup_args}",
            creates     => "/opt/glassfish/config/asenv.conf",
            require     => [ File[cpfusion-cpxp-jar],
                             Exec[cpfusion-glassfish-iptables] ];


I'm told that  "./lib/ant/bin/ant" is not found.   However if I set command => 
"/opt/glassfish/lib/ant/bin/ant -f setup-cluster.xml ${setup_args}",  it works 
fine.




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to