#980 new defect

handle SIGHUP by reloading your config file

Reported by: zooko Owned by: warner
Priority: major Milestone: undecided
Component: code-nodeadmin Version: 1.6.0
Keywords: config signals unix Cc: zancas
Launchpad Bug:

Description

Jacob is writing init scripts for Tahoe-LAFS for Debian, and he asked if it handles SIGHUP by reloading its config file. It currently doesn't. I wonder what all internal state Tahoe-LAFS would have to reset or revisit in order to cleanly "reload its config file". Perhaps the cleanest response to SIGHUP would be to shut down and restart.

Change History (4)

comment:1 Changed at 2010-03-05T05:47:55Z by ioerror

Tahoe should certainly catch SIGHUP for various things. An example that comes to mind is closing and re-opening log files.

comment:2 Changed at 2010-03-10T19:50:55Z by warner

there was a lot of state and configuration stuff set up during init, which is why I gave up on SIGHUP-to-reread-tahoe.cfg pretty early. It would involve replacing the Tub, for a start, which means re-registering all Referenceables, replacing the IntroducerClient and the StorageServer.

OTOH, all of this is contained inside the Node instance, and that's just a Service which can be shut down, so maybe we could handle it by doing a top-level stopService, waiting for that to finish, then re-creating the whole Node and starting it back up. This would retain the same pid but replace pretty much everything else.

Logfiles are handled by twisted.python.log, which rotates at some configurable size (1MB, I think). We could route SIGHUP or SIGUSR1 or something to force that, but in my experience the built-in log rotation has always been sufficient.

comment:3 Changed at 2010-03-25T00:35:43Z by davidsarah

  • Component changed from operational to code-nodeadmin
  • Keywords config signals unix added

comment:4 Changed at 2011-08-18T03:50:48Z by zooko

  • Cc zancas added
Note: See TracTickets for help on using tickets.