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

Bug 380713

Summary: net-p2p/deluge-1.3.3 fails to respect DELUGED_USER
Product: Gentoo Linux Reporter: Jaak Ristioja <jaak>
Component: Current packagesAssignee: Paolo Pedroni <paolo.pedroni>
Status: RESOLVED WORKSFORME    
Severity: major CC: flow, net-p2p
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patched /etc/init.d/deluged file

Description Jaak Ristioja 2011-08-26 06:06:31 UTC
net-p2p/deluge-1.3.3 and likely earlier versions fail to respect the DELUGED_USER variable set in /etc/conf.d/deluged. The daemon is started as root instead:

  PID USER CPU% MEM%   TIME+  Command
    1 root  0.0  0.0  1:57.60 init [3]
27631 root  3.0 14.7 14:24.93  `- /usr/bin/python2.7 /usr/bin/deluged --do-not-daemonize
28145 root  0.0 14.7  0:00.28  |   `- /usr/bin/python2.7 /usr/bin/deluged --do-not-daemonize
28142 root  0.0 14.7  0:41.60  |   `- /usr/bin/python2.7 /usr/bin/deluged --do-not-daemonize
28141 root  1.0 14.7  4:03.34  |   `- /usr/bin/python2.7 /usr/bin/deluged --do-not-daemonize
28140 root  0.0 14.7  0:38.03  |   `- /usr/bin/python2.7 /usr/bin/deluged --do-not-daemonize

This poses a security risk and makes it difficult to set security limits on system resources for the service.
Comment 1 Julien Cassette 2011-09-16 12:06:56 UTC
Created attachment 286671 [details]
Patched /etc/init.d/deluged file

Just change "-u" to "--chuid" in start-stop-daemon lines.
Comment 2 Raúl Porcel (RETIRED) gentoo-dev 2011-09-17 18:35:45 UTC
Fixed, thanks
Comment 3 Raúl Porcel (RETIRED) gentoo-dev 2011-09-21 14:36:56 UTC
Wait a second...i moved from --chuid to --user weeks ago because --chuid is deprecated...

I'll have a look at this...
Comment 4 Raúl Porcel (RETIRED) gentoo-dev 2011-09-21 14:56:37 UTC
Works fine for me, please try to debug it more...
Comment 5 Jaak Ristioja 2011-09-26 23:06:07 UTC
(In reply to comment #3)
> Wait a second...i moved from --chuid to --user weeks ago because --chuid is
> deprecated...

I'm guessing that --chuid was deprecated in some version of baselayout. However, I'm still running baselayout-1.12.14-r1 because the upgrade path would probably require a restart. It seems newer versions of Deluge should have had DEPENDed on newer versions of baselayout regardless whether they are in portage or not.

You might probably mark this as RESOLVED INVALID, but I'm just going to ask just in case other people experience similar issues: An unsupported workaround would be to add --chuid to the init-script for start-stop-daemon invocations starting the deluge core and GUI?
Comment 6 Raúl Porcel (RETIRED) gentoo-dev 2012-04-22 16:18:13 UTC
An option could be to have two init scripts...if i have the time i'll have a look
Comment 7 Paolo Pedroni 2016-02-16 09:36:46 UTC
Older versions of baselayout are not in tree anymore. Current init file works as advertised.

Please reopen if you experience other issues.