Commit Briefs

Thomas Adam

gotd: wait asynchronously for children termination

Instead of the current kill() + waitpid(WNOHANG), manage the subprocesses in a separate queue and handle SIGCHLD. A timer is installed to ensure that misbehaving subprocesses are still killed. Fixes the current "child PID 0 terminated" logs due to races with waitpid(). Issue initially reported by Josiah Frentsos. ok + tweaks stsp@


Thomas Adam

add kill_repo_proc() similarly to the other kill_*_proc()

ok stsp@


Thomas Adam

missing semicolon... sigh

I can't assume I can blindly add one simple line.


Thomas Adam

move gotd_child_proc to gotd.c

make it opaque since it's unused outside of gotd.c. While here, drop the unused `nhelpers' field. ok/tweak stsp@


Thomas Adam

update gotd_proc_names after session process unveil changes

fixes "proc (null)" appearing in gotd logs



Thomas Adam

gotd: return early after disconnect on auth event error

This fixes a segv reported by Mikhail. In this path, any error is already logged, client freed, and event_del() called so we don't need to cleanup in done. ok stsp@



Thomas Adam

avoid gitwrapper printing a warning when /etc/gotd.conf does not exist

gotd still requires the config file, of course, but gitwrapper must treat is as optional and remain silent if the file cannot be found.


Thomas Adam

add gitwrapper(1)

ok op@, tracey@ earlier version


Thomas Adam

portable: configure: split out dependencies

Rather than assume all dependencies are required for all programs, split them out. This will make packaging easier, as well as splitting the code to use subprojects. Note that due to the use of config.h semantics, in most cases the got_compat.h header file is now at the top of the .c file it is included in, so that it can handle the system header inclusion properly.


Thomas Adam

portable: rework SHA detection

Simply the SHA detection by not predicating on libcrypto, but instead checking individual header files.


Thomas Adam

portable: remove sha1.h; found portably

Remove sha1.h as this is found portably across systems.


Thomas Adam

rename lib/sha1.c to lib/hash.c

It will soon grow functions to deal with sha256 too. stsp@ agrees.


Thomas Adam

include sha2.h too where sha1.h is included

In preparation for wide sha256 support; stsp@ agrees. Change done mechanically with find . -iname \*.[cy] -exec sam {} + X ,x/<sha1\.h>/i/\n#include <sha2.h>


Thomas Adam

fix gotd segfault in libevent while disconnecting clients

Sending a DISCONNECT message to the repo process and then killing it and freeing its structure won't work. The message ends up on internal libevent queues and will soon crash because we have freed the memory for the event structre. Sending that message is a leftover from the times when the repo procs were persistent.


Thomas Adam

fix gotd and gotsh usage() function declaration

"function declaration isn't a prototype" should fix the error seen by tracey@ on sparc64


Thomas Adam

make gotd parent dispatch handlers more robust during teardown

We have observed gotd exiting after "cannot find client for fd N" errors. If this occurs then we are likely in the process of disconnecting a client session while processing an event from a child process. Treat the above error as non-fatal and stop processing more events from the child process.


Thomas Adam

remove \n from log message



Thomas Adam

gotd: disconnect on client EOF too

Otherwise gotd keeps the (client-closed) sockets around and may prevent new connections from being established since they still count for the limits. ok jamsek, stsp


Thomas Adam

document the gotd -n option


Thomas Adam

gotd: move socket path check to parse.y and error from the main process

It's handy to have a "bad unix socket path" error being reported directly from the main process since can get caught by `gotd -n'. ok jamsek stsp


Thomas Adam

gotd: move nrepos check to parse_config

ok jamsek stsp


Thomas Adam

gotd: print configuration errors without -d

Defer the absolute path check on argv[0] and log_init so that it becomes possible to run `gotd -n' to check the configuration file and get errors without specifying -d. Erorrs in the configuration now are actually always printed regardless of -d. While here also tweak an error message and print 'configuration OK' if -n ok stsp@