diff options
Diffstat (limited to 'net-proxy/http-replicator/files/http-replicator-3-missing-directory.patch')
-rw-r--r-- | net-proxy/http-replicator/files/http-replicator-3-missing-directory.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/net-proxy/http-replicator/files/http-replicator-3-missing-directory.patch b/net-proxy/http-replicator/files/http-replicator-3-missing-directory.patch new file mode 100644 index 000000000000..37c2ce2361f3 --- /dev/null +++ b/net-proxy/http-replicator/files/http-replicator-3-missing-directory.patch @@ -0,0 +1,51 @@ +Author: Matthew Ogilvie +Date: Sat Jan 17 09:24:34 2015 -0700 + + add some suggestions to the missing-directory error message + + Also wait until directory confirmed before forking. + + See gentoo bug 502574 and bug 442874 + +diff --git a/http-replicator b/http-replicator +index bbc163c..81e254d 100755 +--- a/http-replicator ++++ b/http-replicator +@@ -636,13 +636,6 @@ def main (): + parser.error('user %r does not exist' % options.user) + except OSError: + parser.error('no permission for changing to user %r' % options.user) +- pid = os.fork() # fork process +- if pid: # parent process +- pidfile.write(str(pid)) # store child's pid +- pidfile.close() +- return +- else: +- signal.signal(signal.SIGHUP, signal.SIG_IGN) + else: + handler = logging.StreamHandler(sys.stdout) # log to stdout + handler.setFormatter(logging.Formatter('%(levelname)s: %(name)s %(message)s')) +@@ -651,10 +644,22 @@ def main (): + try: + os.chdir(options.dir) # change to cache directory + except OSError: +- parser.error('invalid directory %r' % options.dir) ++ parser.error('invalid directory %r\n' \ ++ 'Try running repcacheman, and/or see\n' \ ++ 'http://forums.gentoo.org/viewtopic-t-173226.html' \ ++ % options.dir) + if not os.access(os.curdir, os.R_OK | os.W_OK): # check permissions for cache directory + parser.error('no read/write permission for directory %r' % options.dir) + ++ if options.daemon: ++ pid = os.fork() # fork process ++ if pid: # parent process ++ pidfile.write(str(pid)) # store child's pid ++ pidfile.close() ++ return ++ else: ++ signal.signal(signal.SIGHUP, signal.SIG_IGN) ++ + sys.stdout = sys.stderr = open('/dev/null', 'w') # redirect all output to bit bucket + logging.root.name = 'HttpReplicator' + try: |