Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 259879 Details for
Bug 350213
net-p2p/deluge uses single rc script for two daemons
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixed group support for deluged
deluged-setuid.patch (text/plain), 2.73 KB, created by
Cameron Tacklind
on 2011-01-14 19:48:58 UTC
(
hide
)
Description:
Fixed group support for deluged
Filename:
MIME Type:
Creator:
Cameron Tacklind
Created:
2011-01-14 19:48:58 UTC
Size:
2.73 KB
patch
obsolete
> deluge/main.py | 49 ++++++++++++++++++++++++++++++++----------------- > 1 files changed, 32 insertions(+), 17 deletions(-) > >diff --git a/deluge/main.py b/deluge/main.py >index 12959a1..0a07f70 100644 >--- a/deluge/main.py >+++ b/deluge/main.py >@@ -42,6 +42,8 @@ > > import os > import sys >+import pwd >+import grp > from optparse import OptionParser > > import deluge.log >@@ -157,6 +159,10 @@ def start_daemon(): > help="Set the logfile location", action="store", type="str") > parser.add_option("-P", "--pidfile", dest="pidfile", > help="Use pidfile to store process id", action="store", type="str") >+ parser.add_option("-U", "--user", dest="user", >+ help="User to switch to. Only use it when starting as root", action="store", type="str") >+ parser.add_option("-g", "--group", dest="group", >+ help="Group to switch to. Only use it when starting as root", action="store", type="str") > parser.add_option("-L", "--loglevel", dest="loglevel", > help="Set the log level: none, info, warning, error, critical, debug", action="store", type="str") > parser.add_option("-q", "--quiet", dest="quiet", >@@ -196,25 +202,34 @@ def write_pidfile(): > if options.pidfile: > open(options.pidfile, "wb").write("%d\n" % os.getpid()) > >+ # Disable fork on systems that don't support them >+ if deluge.common.windows_check() or deluge.common.osx_check(): >+ options.donot = true >+ > # If the donot daemonize is set, then we just skip the forking > if not options.donot: >- # Windows check, we log to the config folder by default >- if deluge.common.windows_check() or deluge.common.osx_check(): >- open_logfile() >- write_pidfile() >- else: >- if os.fork() == 0: >- os.setsid() >- if os.fork() == 0: >- open_logfile() >- write_pidfile() >- else: >- os._exit(0) >- else: >- os._exit(0) >- else: >- # Do not daemonize >- write_pidfile() >+ if os.fork(): >+ # We've forked and this is now the parent process, so die! >+ os._exit(0) >+ os.setsid() >+ # Kill second fork >+ if os.fork(): >+ os._exit(0) >+ >+ # Write pid file before chuid >+ write_pidfile() >+ >+ if not deluge.common.windows_check(): >+ if options.group: >+ if not options.group.isdigit(): >+ options.group = grp.getgrnam(options.group)[2] >+ os.setgid(options.group) >+ if options.user: >+ if not options.user.isdigit(): >+ options.user = pwd.getpwnam(options.user)[2] >+ os.setuid(options.user) >+ >+ open_logfile() > > # Setup the logger > try:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 350213
:
258495
|
258969
|
258971
|
258973
|
258975
|
258976
|
258978
|
258979
| 259879 |
259880