tests: fix void and invalid test in test-archive.t
An echo statement was missed in the .t-ification in
afe19a1bf9d3 so we ended up
with invalid sh syntax. But at the same time a continuation line was marked as
$ instead of > and we thus added the salt that made the expression valid again.
cmdutil.service: move pidfile writing to the parent in daemon mode
There is a potential race here, which I suspect I've spotted in the wild, where
something reads the pid file after the parent exits but before the child has
had a chance to write to it. Moving writing the file to the parent causes this
to no longer be an issue.
cmdutil.service: move pidfile writing to a local function
An upcoming patch will reuse this code.
inotify: add pidfile to parent options
An upcoming patch will move pidfile writing from the parent to the child. This
means that if the pid file isn't specified on the command-line but is specified
as a config option, it needs to be added to the parent's opts dict.
get-with-headers: don't block indefinitely if the server had an internal error
If the server had an internal error and returned 500, there's nothing
to read, so "response.read()" blocks indefinitely. Only output the
response if there's really a response.