Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed size /tmp in Fedora 19 box #188

Closed
hectcastro opened this issue Mar 10, 2014 · 9 comments
Closed

Fixed size /tmp in Fedora 19 box #188

hectcastro opened this issue Mar 10, 2014 · 9 comments

Comments

@hectcastro
Copy link
Contributor

/tmp in the Fedora 19 box is currently ~255MB, which gets exhausted with almost any Chef run that extracts an archive into Chef's cache directory.

Executing the following prevents /tmp from being created as tmpfs:

# systemctl mask tmp.mount
@juliandunn
Copy link
Contributor

@hectcastro Any idea how you turn this off for realzies on a Fedora box? I'd happily add it to some systemd unit or whatever if I knew how.

@bflad
Copy link
Contributor

bflad commented Mar 12, 2014

Here's the full story: https://fedoraproject.org/wiki/Features/tmp-on-tmpfs

It seems that Chef should possibly change from using /tmp as the cache directory to match Fedora's filesystem guidelines? Maybe:

  • From the linked page: "Programs should follow the rule: if you are privileged, place it in /run/<your-program-name>/. Otherwise, if it's large or needs persistency across reboots, place it in /var/tmp."
  • /var/cache/chef

The systemd unit file it seems is created by default at: /usr/lib/systemd/system/tmp.mount

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Temporary Directory
Documentation=man:hier(7)
Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target

[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime

Let me know if you'd like me to submit a ticket to CHEF.

@bflad
Copy link
Contributor

bflad commented Mar 12, 2014

Although if Chef is already not using /tmp for file_cache_path on Fedora, wouldn't you be violating http://acrmp.github.io/foodcritic/#FC013? Trying to find the Chef code from my phone to confirm.

@bflad
Copy link
Contributor

bflad commented Mar 12, 2014

Chef caching defaults to /var/chef/cache according to the code unless its configured differently (file_cache_path or chef-client cookbook attribute in my experience).

@hectcastro
Copy link
Contributor Author

A wild @bflad appears.

After a closer look, this is being caused by the default location of Test Kitchen's cache:

[vagrant@default-fedora-19 ~]$ cat /tmp/kitchen/solo.rb
node_name "default-fedora-19"
checksum_path "/tmp/kitchen/checksums"
file_cache_path "/tmp/kitchen/cache"
file_backup_path "/tmp/kitchen/backup"
cookbook_path ["/tmp/kitchen/cookbooks", "/tmp/kitchen/site-cookbooks"]
data_bag_path "/tmp/kitchen/data_bags"
environment_path "/tmp/kitchen/environments"
node_path "/tmp/kitchen/nodes"
role_path "/tmp/kitchen/roles"
client_path "/tmp/kitchen/clients"
user_path "/tmp/kitchen/users"
validation_key "/tmp/kitchen/validation.pem"
client_key "/tmp/kitchen/client.pem"
chef_server_url "http://127.0.0.1:8889"
encrypted_data_bag_secret "/tmp/kitchen/encrypted_data_bag_secret"

Given Fedora's file system guidelines, I probably need to find a way to override the default provisioner root_path for Fedora tests.

@juliandunn
Copy link
Contributor

@hectcastro Yes, and you should be able to do that within the driver config for test-kitchen -- I've done that successfully.

@hectcastro
Copy link
Contributor Author

For anyone who is interested, the real issue appears to be the ark provider for the java cookbook: https://github.com/socrata-cookbooks/java/blob/master/providers/ark.rb#L152-L159 (when you try to install the Oracle JDK).

@hectcastro
Copy link
Contributor Author

Hopefully resolved in sous-chefs/java#150.

@sciurus
Copy link

sciurus commented Sep 7, 2014

Could you reconsider disabling tmp on tmprfs for Fedora? Like @hectcastro said all that would take is running systemctl mask tmp.mount. That will permanently make the necessary systemd unit changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants