anchor.diff:                   pub-server-port (nth-value 1 (sb-bsd-sockets:socket-name *tcp-server*)))
              (ros-debug (roslisp top) "Started tcpros server on port ~a" pub-server-port)
   
  -  
  -	   (setq *tcp-server-port* pub-server-port
  -		 *broken-socket-streams* (make-hash-table :test #'eq)
  -		 *service-uri* (format nil "rosrpc://~a:~a" *tcp-server-hostname* *tcp-server-port*)
  -		 *xml-rpc-caller-api* (format nil "http://~a:~a" (hostname) xml-rpc-port)
  -		 *publications* (make-hash-table :test #'equal)
  -		 *subscriptions* (make-hash-table :test #'equal)
  -		 *services* (make-hash-table :test #'equal)
  -		 *node-status* :running
  +           
  +           (setq *tcp-server-port* pub-server-port
  +                 *broken-socket-streams* (make-hash-table :test #'eq)
  +                 *service-uri* (format nil "rosrpc://~a:~a" *tcp-server-hostname* *tcp-server-port*)
  +                 *xml-rpc-caller-api* (format nil "http://~a:~a" (hostname) xml-rpc-port)
  +                 *publications* (make-hash-table :test #'equal)
  +                 *subscriptions* (make-hash-table :test #'equal)
  +                 *services* (make-hash-table :test #'equal)
  +                 *node-status* :running
                    *deserialization-threads* nil
  -		 )
  -
  -	   ;; Finally, start the serve-event loop
  -	   (event-loop))
  +                 )
  +
  +           (pushnew #'maybe-shutdown-ros-node sb-ext:*exit-hooks*)
  +
  +           ;; Finally, start the serve-event loop
  +           (event-loop))
          :name "ROSLisp event loop")
   
         ;; There's no race condition - if this test and the following advertise call all happen before the event-loop starts,
  
positive.code:   (dbind (name &rest a &key spin &allow-other-keys) args
      (declare (ignorable name a))
      `(unwind-protect
  	  (restart-case 
  	      (progn
  		(start-ros-node ,@args)
  		,@body
  		,@(when spin `((spin-until nil 100))))
  	    (shutdown-ros-node (&optional a) (ros-info (roslisp top) "About to shutdown~:[~; due to condition ~:*~a~]" a)))
         (shutdown-ros-node))))
  
  
  
negative.code:       (close *ros-log-stream*)
        (when *running-from-command-line* (sb-ext:quit)))))
  
  (defun maybe-shutdown-ros-node ()
    (unless (eq *node-status* :shutdown)
      (shutdown-ros-node)))
  
  