Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 534014

Summary: net-vpn/tor systemd service requires CAP_SYS_RESOURCE
Product: Gentoo Linux Reporter: Chris Wells <gentoo.intel>
Component: Current packagesAssignee: John Helmert III <ajak>
Status: UNCONFIRMED ---    
Severity: normal CC: candrews, sam, stlman, systemd
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=529212
Whiteboard:
Package list:
Runtime testing required: ---

Description Chris Wells 2014-12-30 14:08:20 UTC
Recent versions of Tor fail to start on my hardened gentoo with:

[warn] You appear to lack permissions to change memory limits. Are you root?
[warn] Unable to raise RLIMIT_MEMLOCK: Operation not permitted
[notice] Unable to lock all current and future memory pages: Cannot allocate memory

If I add CAP_SYS_RESOURCE to the CapabilityBoundingSet line, Tor starts fine.
Comment 1 Anthony Basile gentoo-dev 2015-03-07 18:59:41 UTC
(In reply to Chris Wells from comment #0)
> Recent versions of Tor fail to start on my hardened gentoo with:
> 
> [warn] You appear to lack permissions to change memory limits. Are you root?
> [warn] Unable to raise RLIMIT_MEMLOCK: Operation not permitted
> [notice] Unable to lock all current and future memory pages: Cannot allocate
> memory
> 
> If I add CAP_SYS_RESOURCE to the CapabilityBoundingSet line, Tor starts fine.

I don't understand systemd to be honest, so I don't know what to do here.

Can someone in the systemd team help me out?
Comment 2 Anthony Basile gentoo-dev 2015-03-07 23:53:41 UTC
*** Bug 542464 has been marked as a duplicate of this bug. ***
Comment 3 Anthony Basile gentoo-dev 2015-03-07 23:59:44 UTC
I think this might be fixed with 0.2.6.3 but I'm not sure.  Can you test.
Comment 4 Craig Andrews gentoo-dev 2016-07-27 02:54:25 UTC
I personally don't see this error, so either I don't know how to reproduce it or it has been fixed (I'm using net-misc/tor-0.2.8.5_rc).

If this problem still exists, it should probably be reported upstream at https://trac.torproject.org/ as well.
Comment 5 Mike Gilbert gentoo-dev 2016-07-27 17:34:42 UTC
(In reply to Anthony Basile from comment #1)
> I don't understand systemd to be honest, so I don't know what to do here.
> 
> Can someone in the systemd team help me out?

Would love to help, but I don't understand tor, and I don't know what capabilities it might need.

https://www.freedesktop.org/software/systemd/man/systemd.exec.html#CapabilityBoundingSet=

If upstream provides the systemd unit, they would be in the best position to fix it.