It came to my attention this morning that some admins mount the /tmp with
the noexec flag
The java::oracle recipe downloads the oracle jdk*.bin file to the tmp
directory and executes it there. The result is an unpacked jdk directory
Would it be useful for me to use a new directory like /var/chef/tmp instead
of /tmp for this kind of thing?
i prefer to use the Chef::Config[:file_cache_path] (which usually points to
/var/chef/cache) for similar use cases
On Thu, Jun 14, 2012 at 2:02 PM, Bryan Berry bryan.berry@gmail.com wrote:
It came to my attention this morning that some admins mount the /tmp with
the noexec flag
The java::oracle recipe downloads the oracle jdk*.bin file to the tmp
directory and executes it there. The result is an unpacked jdk directory
Would it be useful for me to use a new directory like /var/chef/tmp
instead of /tmp for this kind of thing?
I mirror Ranjib Dey's feedback -- we use the :file_cache_path for
similar purposes
--AJ
On 14 June 2012 18:05, Ranjib Dey ranjibd@thoughtworks.com wrote:
i prefer to use the Chef::Config[:file_cache_path] (which usually points to
/var/chef/cache) for similar use cases
On Thu, Jun 14, 2012 at 2:02 PM, Bryan Berry bryan.berry@gmail.com wrote:
It came to my attention this morning that some admins mount the /tmp with
the noexec flag
The java::oracle recipe downloads the oracle jdk*.bin file to the tmp
directory and executes it there. The result is an unpacked jdk directory
Would it be useful for me to use a new directory like /var/chef/tmp
instead of /tmp for this kind of thing?
Hi,
On Wed, Jun 13, 2012 at 11:05 PM, Ranjib Dey ranjibd@thoughtworks.com wrote:
i prefer to use the Chef::Config[:file_cache_path] (which usually points to
/var/chef/cache) for similar use cases
I'm also a fan of of using Chef::Config[:file_cache_path] for things
like this. It is also helpful in cases where /tmp is being mounted as
a tmpfs and avoid chef-client runs periodically taking longer after
something cleared out /tmp.
Cheers,
Steven
sounds like there is consensus
Would this make for a good foodcritic rule?
Dir.mktmpdir w/out arguments creates a directory in /tmp
Dir.mktmpdir("/foo/bar") creates a tmpdir in /foo/bar/
a foodcritic rule would flag Dir.mktmpdir w/out a prefix
Would such a rule be useful to anyone besides me?
On Thu, Jun 14, 2012 at 8:11 AM, Steven Danna steve@opscode.com wrote:
Hi,
On Wed, Jun 13, 2012 at 11:05 PM, Ranjib Dey ranjibd@thoughtworks.com
wrote:
i prefer to use the Chef::Config[:file_cache_path] (which usually points
to
/var/chef/cache) for similar use cases
I'm also a fan of of using Chef::Config[:file_cache_path] for things
like this. It is also helpful in cases where /tmp is being mounted as
a tmpfs and avoid chef-client runs periodically taking longer after
something cleared out /tmp.
Cheers,
Steven
On Thu, Jun 14, 2012 at 4:16 PM, Bryan Berry bryan.berry@gmail.com wrote:
sounds like there is consensus
Would this make for a good foodcritic rule?
Just a heads up on:
http://tickets.opscode.com/browse/CHEF-2786
Which can result in issues like this:
opened 01:35AM - 09 Feb 12 UTC
closed 08:28PM - 23 May 13 UTC
I bootstrap rbenv+ruby+bundler+chef as a user install under `/root/.rbenv`, then… invoke a chef-solo run to install system wide.
The apt cache-client recipe installs fine, so chef seems to run fine fine.
At the ruby_build install stage this happens:
```
[Thu, 09 Feb 2012 12:28:45 +1100] INFO: Processing package[tar] action install (ruby_build::default line 34)
[Thu, 09 Feb 2012 12:28:45 +1100] INFO: Processing package[bash] action install (ruby_build::default line 34)
[Thu, 09 Feb 2012 12:28:45 +1100] INFO: Processing package[curl] action install (ruby_build::default line 34)
[Thu, 09 Feb 2012 12:28:45 +1100] INFO: Processing package[git-core] action install (ruby_build::default line 34)
[Thu, 09 Feb 2012 12:28:45 +1100] INFO: Processing execute[Install ruby-build] action nothing (ruby_build::default line 38)
[Thu, 09 Feb 2012 12:28:45 +1100] INFO: Processing git[/root/.chef/state/cache/ruby-build] action checkout (ruby_build::default line 48)
[Thu, 09 Feb 2012 12:28:45 +1100] ERROR: git[/root/.chef/state/cache/ruby-build] (ruby_build::default line 48) has had an error
[Thu, 09 Feb 2012 12:28:45 +1100] ERROR: git[/root/.chef/state/cache/ruby-build] (/home/hedge/personal-chef/cookbooks/ruby_build/recipes/default.rb:48:in `from_file') had an error:
git[/root/.chef/state/cache/ruby-build] (ruby_build::default line 48) had an error: Chef::Exceptions::MissingParentDirectory: Cannot clone git[/root/.chef/state/cache/ruby-build] to /root/.chef/state/cache/ruby-build, the enclosing directory /root/.chef/state/cache does not exist
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/provider/git.rb:81:in `assert_target_directory_valid!'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/provider/git.rb:39:in `action_checkout'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource.rb:440:in `run_action'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:45:in `run_action'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:81:in `each'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:81:in `block in converge'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection.rb:94:in `block in execute_each_resource'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection.rb:92:in `execute_each_resource'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:76:in `converge'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/client.rb:312:in `converge'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/client.rb:160:in `run'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:192:in `block in run_application'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:183:in `loop'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:183:in `run_application'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/lib/chef/application.rb:67:in `run'
/home/hedge/personal-chef/vendor/ruby/1.9.1/gems/chef-0.10.8/bin/chef-solo:25:in `<top (required)>'
/home/hedge/personal-chef/vendor/ruby/1.9.1/bin/chef-solo:19:in `load'
/home/hedge/personal-chef/vendor/ruby/1.9.1/bin/chef-solo:19:in `<main>'
[Thu, 09 Feb 2012 12:28:45 +1100] ERROR: Running exception handlers
[Thu, 09 Feb 2012 12:28:45 +1100] ERROR: Exception handlers complete
[Thu, 09 Feb 2012 12:28:45 +1100] FATAL: Stacktrace dumped to /root/.chef/state/cache/chef-stacktrace.out
[Thu, 09 Feb 2012 12:28:45 +1100] FATAL: Chef::Exceptions::MissingParentDirectory: git[/root/.chef/state/cache/ruby-build] (ruby_build::default line 48) had an error: Chef::Exceptions::MissingParentDirectory: Cannot clone git[/root/.chef/state/cache/ruby-build] to /root/.chef/state/cache/ruby-build, the enclosing directory /root/.chef/state/cache does not exist
```
The workaround for which is:
committed 07:24AM - 09 Feb 12 UTC
HTH
Dir.mktmpdir w/out arguments creates a directory in /tmp
Dir.mktmpdir("/foo/bar") creates a tmpdir in /foo/bar/
a foodcritic rule would flag Dir.mktmpdir w/out a prefix
Would such a rule be useful to anyone besides me?
On Thu, Jun 14, 2012 at 8:11 AM, Steven Danna steve@opscode.com wrote:
Hi,
On Wed, Jun 13, 2012 at 11:05 PM, Ranjib Dey ranjibd@thoughtworks.com
wrote:
i prefer to use the Chef::Config[:file_cache_path] (which usually points
to
/var/chef/cache) for similar use cases
I'm also a fan of of using Chef::Config[:file_cache_path] for things
like this. It is also helpful in cases where /tmp is being mounted as
a tmpfs and avoid chef-client runs periodically taking longer after
something cleared out /tmp.
Cheers,
Steven
--
πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα
[The fox knows many things, but the hedgehog knows one big thing.]
Archilochus, Greek poet (c. 680 BC – c. 645 BC)
http://hedgehogshiatus.com
hmm, sounds like this calls for a new primitive
Dir.chef_tmpdir that creates a tmpdir in the caching path that chef
configured to use
On Thu, Jun 14, 2012 at 2:44 PM, Hedge Hog hedgehogshiatus@gmail.com wrote:
On Thu, Jun 14, 2012 at 4:16 PM, Bryan Berry bryan.berry@gmail.com
wrote:
sounds like there is consensus
Would this make for a good foodcritic rule?
Just a heads up on:
http://tickets.opscode.com/browse/CHEF-2786
Which can result in issues like this:
Fails with: the enclosing directory /root/.chef/state/cache does not exist · Issue #2 · sous-chefs/ruby_build · GitHub
The workaround for which is:
A workaround that closes issue #2 · hedgehog/chef-ruby_build@3ad5860 · GitHub
HTH
Dir.mktmpdir w/out arguments creates a directory in /tmp
Dir.mktmpdir("/foo/bar") creates a tmpdir in /foo/bar/
a foodcritic rule would flag Dir.mktmpdir w/out a prefix
Would such a rule be useful to anyone besides me?
On Thu, Jun 14, 2012 at 8:11 AM, Steven Danna steve@opscode.com wrote:
Hi,
On Wed, Jun 13, 2012 at 11:05 PM, Ranjib Dey ranjibd@thoughtworks.com
wrote:
i prefer to use the Chef::Config[:file_cache_path] (which usually
points
to
/var/chef/cache) for similar use cases
I'm also a fan of of using Chef::Config[:file_cache_path] for things
like this. It is also helpful in cases where /tmp is being mounted as
a tmpfs and avoid chef-client runs periodically taking longer after
something cleared out /tmp.
Cheers,
Steven
--
πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα
[The fox knows many things, but the hedgehog knows one big thing.]
Archilochus, Greek poet (c. 680 BC – c. 645 BC)
http://hedgehogshiatus.com