diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-07-15 14:50:43 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-07-15 14:50:43 -0400 |
commit | 773a8092b8974d1abc9882d4dac096ff0a5c4a60 (patch) | |
tree | d66707bf28957fbfa8629553bad7f9f6249cdade | |
parent | 0471c35d7e18b4ac23c8342dea75c327dff153cc (diff) | |
download | grokmirror-773a8092b8974d1abc9882d4dac096ff0a5c4a60.tar.gz |
Document refresh and socket options
Plus a few quickfixes, because I'm too lazy to properly stage patches.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | grokmirror.conf | 15 | ||||
-rwxr-xr-x | grokmirror/pull.py | 7 |
2 files changed, 20 insertions, 2 deletions
diff --git a/grokmirror.conf b/grokmirror.conf index 5fba375..4ae3c8e 100644 --- a/grokmirror.conf +++ b/grokmirror.conf @@ -145,6 +145,21 @@ include = * # git sources: #exclude = */linux-2.4* exclude = +# +# If you enable the following option, then instead of exiting after a completed run, +# grok-pull will continue to operate and will periodically recheck the remote +# maniefest for new updates. See contrib for an example systemd service you can set up +# to continuously update your local mirror. +# The value is in seconds. +#refresh = 900 +# +# If you enable refresh, you can also enable the socket listener that allows for rapid +# push notifications from your primary mirror. The socket expects repository names matching +# what is in the local manifest, followed by a newline. E.g.: +# /pub/scm/linux/kernel/git/torvalds/linux.git\n +# Anything not matching a repository in the local manifest will be ignored. +# TODO: provide the pubsub example once it's written +#socket = ${core:toplevel}/.updater.socket # Used by grok-fsck [fsck] diff --git a/grokmirror/pull.py b/grokmirror/pull.py index f3eb35d..6870701 100755 --- a/grokmirror/pull.py +++ b/grokmirror/pull.py @@ -58,8 +58,9 @@ class SignalHandler: self.sw.join() for pw in self.pws: - pw.terminate() - pw.join() + if pw: + pw.terminate() + pw.join() if len(self.done): update_manifest(self.config, self.done) @@ -865,7 +866,9 @@ def update_manifest(config, entries): def socket_worker(config, q_todo, sockfile): logger.info(' listener: listening on socket %s', sockfile) + curmask = os.umask(0) with ThreadedUnixStreamServer(sockfile, Handler) as server: + os.umask(curmask) # Stick some objects into the server server.q_todo = q_todo server.config = config |