diff --git a/btcd.go b/btcd.go
index <HASH>..<HASH> 100644
--- a/btcd.go
+++ b/btcd.go
@@ -94,6 +94,11 @@ func btcdMain(serverChan chan<- *server) error {
 			cfg.Listeners, err)
 		return err
 	}
+	addInterruptHandler(func() {
+		btcdLog.Infof("Gracefully shutting down the server...")
+		server.Stop()
+		server.WaitForShutdown()
+	})
 	server.Start()
 	if serverChan != nil {
 		serverChan <- server
@@ -107,6 +112,7 @@ func btcdMain(serverChan chan<- *server) error {
 	// for the interrupt handler goroutine to finish.
 	go func() {
 		server.WaitForShutdown()
+		srvrLog.Infof("Server shutdown complete")
 		shutdownChannel <- true
 	}()
 
diff --git a/server.go b/server.go
index <HASH>..<HASH> 100644
--- a/server.go
+++ b/server.go
@@ -728,7 +728,6 @@ func (s *server) Stop() error {
 // WaitForShutdown blocks until the main listener and peer handlers are stopped.
 func (s *server) WaitForShutdown() {
 	s.wg.Wait()
-	srvrLog.Infof("Server shutdown complete")
 }
 
 // ScheduleShutdown schedules a server shutdown after the specified duration.
Shutdown server fully on ctrl-c

since we don't wait for peers, this largely just waits for the server procs
themselves to die. Unless the entire server is wedged (which is what kill -9 is
for) this should always shut down fairly swiftly.

This should mean we sync addrmanager and disestablish upnp correctly on
interrupt.

Discussed with davec.