Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

Install / configure process needs additional file limit settings for ubuntu >= 14.04 #104

Open
neocogent opened this issue Jul 13, 2015 · 7 comments

Comments

@neocogent
Copy link

I messed around with this for ages but using default configure and install guide does not work for setting file limits. Some googling helped me figure out that on 14.04 and perhaps afterwards you cannot raise file limits without also adding settings for pam. Maybe these could be added to configure or at least install guide.

Edit /etc/pam.d/common-session* and add the following line. Note the * as there are 2 files that need editing for this to work.

session required pam_limits.so

Once I did this the electrum user finally was seeing the raised nofile limits.

@OverlordQ
Copy link
Contributor

Since most users are running this as a separate user, only the sudo pam settings should need tweaked. Getting something in either of the common-session files wrong can completely destroy your system.

@neocogent
Copy link
Author

Not sure why you say that.
I am running it as user electrum and needed to do this before it would work. AFAIK this is tied to the user id and not whether using sudo to start it. I did use sudo to start electrum-server and it did not work (on Ubuntu 14.04).

Also, I have it started at boot with an init conf but don't think I've tested that process yet.

@OverlordQ
Copy link
Contributor

Because unless you have physical access to the box, getting something wrong in the pam config files can and will prevent you from logging into the server completely.

So touching common-session* should be a last resort and only done if you really know what you're doing.

@neocogent
Copy link
Author

I don't disagree with that. But what are you suggesting as alternative? You said "adjust sudo pam settings" but what do you mean by that and have you tested that it works? I'm only looking for a tested working piece of info that could be added to the install guide.

@OverlordQ
Copy link
Contributor

For at least Debian pam_limits is already included in /etc/pam.d/sshd, so the only thing that should affect the limits not being applied is the fact that users are sudo'ing into another acccount. To allow the limits to persist through the sudo you need to add session required pam_limits.so to /etc/pam.d/sudo as well.

@neocogent
Copy link
Author

Ok. Thanks.

I've reverted my changes and added this instead and will test if electrum continues to work correctly.

@neocogent
Copy link
Author

Unfortunately this does not work.

After removing setting from common-session-* and adding to sudo the electrum server behaves with problems as if limits not set. That is, it goes to 100% and becomes comatose, not processing blocks.

After reverting to the common-session-* files electrum server once again behaves fine.

Maybe the setting needs to be made in a certain order in the file as I notice there are includes, and I placed this line before those.

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

2 participants