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

glusterfs: add service #22225

Merged
merged 2 commits into from Feb 4, 2017
Merged

glusterfs: add service #22225

merged 2 commits into from Feb 4, 2017

Conversation

bachp
Copy link
Member

@bachp bachp commented Jan 28, 2017

Motivation for this change

Run GlusterFS as a service and allow to mount GlusterFS volumes via configuration.nix

Fixes #9877

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@kevincox kevincox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how strict our style enforcement is but there is a lot more whitespace then I am used to seeing. For example opening brace of set on the same line as the last code.

{ config, lib, pkgs, ... }:
with lib;
let
 ...
in {

Looks good to me otherwise though.

@bachp
Copy link
Member Author

bachp commented Jan 29, 2017

The steucture was taken from the IPFS module and thats also where the style comes from.

@bachp bachp changed the title Glusterfs service glusterfs: add service Feb 2, 2017
@bachp
Copy link
Member Author

bachp commented Feb 2, 2017

Most modules in the network-filesystems have the same style so I don't think I it should be changed.

Any other concernes?

This service is only limited in configuration options.
But it is sufficient to run glusterd and configure it using the gluster command
@bachp
Copy link
Member Author

bachp commented Feb 2, 2017

I rerbased it on master.

@kevincox
Copy link
Contributor

kevincox commented Feb 2, 2017

No other concerns. I'm happy with it.

@joachifm
Copy link
Contributor

joachifm commented Feb 3, 2017

Is it feasible to constrain the daemon a bit or does it need to run with full root capabilities?

@bachp
Copy link
Member Author

bachp commented Feb 3, 2017

I didn't find distro where gluster isn't running as root. I haven't tried it tough.

@joachifm
Copy link
Contributor

joachifm commented Feb 3, 2017

Looking more into glusterfs, I get the impression that you wouldn't ordinarily deploy it on a desktop or anywhere with direct access to the external network, so it's not that much of a concern that it runs unconstrained.

@bachp
Copy link
Member Author

bachp commented Feb 4, 2017

I did some digging and I couldn't get gluster running as non root. The main reason as stated here is that gluster uses the underlying filesystem to store ACL etc. So it needs to be able to create and delete files as any user.

Further it is also required to disable the firewall or at least open a port range as gluster doesn't only use some fixed ports.

@joachifm
Copy link
Contributor

joachifm commented Feb 4, 2017

I see. If it needs root only to perform file operations as any user, it ought to be possible to limit the capabilities somewhat at least, but, again, only bother if it's likely to be deployed on anything but a dedicated closed-off system.

@bachp
Copy link
Member Author

bachp commented Feb 4, 2017

@joachifm It's unlikely. It is mostly used in a closed environment with fast interconnects.

@joachifm joachifm merged commit 17cc22a into NixOS:master Feb 4, 2017
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.glusterfs ];

services.rpcbind.enable = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note rpcbind is not necessarily something you want to have running unless you need to use NFS. I filed an issue about this upstream here, hopefully soon the dependency on rpcbind will be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the input. I think NFS could be added as an option (disabled by default) and this can be used to determine if rpcbind should be started.

nh2 added a commit to nh2/nixpkgs that referenced this pull request Jul 12, 2017
nh2 added a commit to nh2/nixpkgs that referenced this pull request Sep 17, 2017
nh2 added a commit to nh2/nixpkgs that referenced this pull request Sep 27, 2017
nh2 added a commit to nh2/nixpkgs that referenced this pull request Sep 27, 2017
nh2 added a commit to nh2/nixpkgs that referenced this pull request Sep 30, 2017
fpletz pushed a commit that referenced this pull request Oct 3, 2017
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

Successfully merging this pull request may close these issues.

None yet

4 participants