Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Fixes to swapfile permissions and to implied OS support #7

Merged
merged 2 commits into from
Oct 30, 2014

Conversation

mattock
Copy link
Contributor

@mattock mattock commented Oct 30, 2014

This is a nice module which I'm now using, but I had to fix a few issues. The commit messages should be pretty self-explanatory but if you have any questions just let me know.

Note that I was not able to run the bundler tests because of the dependency hell "bundle install" got me into. I would appreciate if you could add whatever tests that might be required.

The code will not work on FreeBSD because mkswap is missing and swapon has a
differing syntax from Linux. As it is, the swapfile will be created on FreeBSD
but everything after that fails.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
The generated swapfile had world-readable permissions by default (root:root,
644). Added a File resource which ensures that permissions are set to 600.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
@petems
Copy link
Owner

petems commented Oct 30, 2014

Hi @mattock!

What issues did you get when you tried a bundle install? I'll see if I can fix those.

I haven't used BSD much before, but from a quick google it should be able to use the same commands for swap files, I'll see if can get a vagrant setup to get it working 👍

@petems
Copy link
Owner

petems commented Oct 30, 2014

I'm having a go with FreeBSD support here: http://www.techonia.com/1807/add-swap-file-linux-freebsd

I'll see how long it takes, if it's a big deal I'll merge this 👍

petems added a commit that referenced this pull request Oct 30, 2014
Fixes to swapfile permissions and to implied OS support
@petems petems merged commit 492daa1 into petems:master Oct 30, 2014
@petems petems mentioned this pull request Oct 30, 2014
@mattock
Copy link
Contributor Author

mattock commented Oct 30, 2014

The "bundle install" failed because gem (libcometa or something) depended on ruby1.9. However, trying to migrate to ruby1.9 failed because the Puppet packages from Puppetlabs apt repos depended on ruby1.8. I did not dig too deeply into this yet, because I didn't want to mess a production Puppet master due to a trivial change. I will probably have to setup a separate environment where I can more safely install whatever gems I happen to need and not worry about breaking things.

@petems
Copy link
Owner

petems commented Oct 30, 2014

Ah ok, yeah you'd want to do the bundle install on a dev machine or something transient (vagrant or some sort of VM), there's a whole heap of issues with Ruby dependancies.

But cool, I've merged this, added specs and might try and add FreeBSD support in the future. If you have any ideas on how to do it, feel free to gimme a merge! 👍

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

Successfully merging this pull request may close these issues.

2 participants