Skip to content
This repository has been archived by the owner on Aug 29, 2019. It is now read-only.

Add options to set ulimit configures #42

Open
robsonpeixoto opened this issue Feb 27, 2017 · 8 comments
Open

Add options to set ulimit configures #42

robsonpeixoto opened this issue Feb 27, 2017 · 8 comments

Comments

@robsonpeixoto
Copy link

Some process need to open to many files, like prometheus, and you need to configure the number of files a process can open.
But the poise-service to have this feature.

Some useful links:

The sysvinit and inittab just need to execute the ulimit command on the script.

But what's the better way to implement it? As a provider option or as a poise_service option?

Thanks

@coderanger
Copy link
Member

Is there a reason to not do this in the command for the service?

You could use something like command "bash -c 'ulimit -whatever && myapp'" or something like chpst from Runit. If you really want to do it in service framework, I would make a custom service template and point at that.

@robsonpeixoto
Copy link
Author

@coderanger It'll work, but IMO is not a elegant solution.

And is better add a exec before execute myapp. It'll avoid a lot of errors with signal command "bash -c 'ulimit -whatever && exec myapp'"

@coderanger
Copy link
Member

Yeah, something like that :) Not against supporting it as a provider option per se but I'm trying to avoid tooooo much template sprawl.

@robsonpeixoto
Copy link
Author

If you would like, I can implement it as a provider option and open a PR.

@coderanger
Copy link
Member

That would be a long term project to figure out how best to integrate so I would just use one of the workarounds from above for now.

@robsonpeixoto
Copy link
Author

I'm already using the bash -c ... workarround.

@alicebob
Copy link

alicebob commented Sep 25, 2017

But ulimit && mything won't play nice with a non-root user= argument. (I need to set the number of open files). Even having a free-form key-value hash which ends up in the config would already be nice.

(I need to set LimitNOFILE somewhere)

@coderanger
Copy link
Member

@alicebob Indeed, you can use a custom template file for all the core providers to fully override things not otherwise exposed in the API.

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

No branches or pull requests

3 participants