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

nixos/beanstalkd: new service for existing package #55953

Merged
merged 1 commit into from Feb 22, 2019

Conversation

aanderse
Copy link
Member

Motivation for this change

No service for beanstalkd exists.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@aanderse
Copy link
Member Author

@GrahamcOfBorg test beanstalkd

@aanderse
Copy link
Member Author

@GrahamcOfBorg test beanstalkd

@aanderse
Copy link
Member Author

@zimbatm as the listed maintainer for the beanstalkd package do you have any issue with this?

DynamicUser = true;
Restart = "always";
ExecStart = "${pkg}/bin/beanstalkd -l ${cfg.listen.address} -p ${toString cfg.listen.port}";
};
Copy link
Member

Choose a reason for hiding this comment

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

@flokli are there any more options that could be used to sandbox the service even more?

Copy link
Contributor

Choose a reason for hiding this comment

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

From what I read, beanstalkd doesn't really use local files, so you could use
TemporaryFileSystem= to mask out most of the filesystem too.

Apart from that, you could look into SystemCallFilter=, and some resource limits.

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds great! Unfortunately I'm not overly familiar with beanstalkd and the inner workings (I have an old application currently running on Debian which uses beanstalkd and I'm trying to move the app to NixOS), or setting up limitations with systemd to this extent. Do you have specific suggestions as to what limitations I should add?

DynamicUser = true;
Restart = "always";
ExecStart = "${pkg}/bin/beanstalkd -l ${cfg.listen.address} -p ${toString cfg.listen.port}";
};
Copy link
Contributor

Choose a reason for hiding this comment

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

From what I read, beanstalkd doesn't really use local files, so you could use
TemporaryFileSystem= to mask out most of the filesystem too.

Apart from that, you could look into SystemCallFilter=, and some resource limits.

nixos/tests/beanstalkd.nix Outdated Show resolved Hide resolved
@zimbatm
Copy link
Member

zimbatm commented Feb 22, 2019

merging as it's good enough. My bad for holding the PR back with additional requirements.

@zimbatm zimbatm merged commit e5405f9 into NixOS:master Feb 22, 2019
@aanderse
Copy link
Member Author

Thanks @zimbatm! I'll try to make some time to study up on the systemd features @flokli mentioned and come back around to this at some point.

@aanderse aanderse deleted the beanstalk branch February 22, 2019 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants