Index: src/Fragmentation/Automation/Pool/PoolWorker.cpp
===================================================================
--- src/Fragmentation/Automation/Pool/PoolWorker.cpp	(revision 9a3f84cbd399e3427447ded42db8f62d11fd2e1d)
+++ src/Fragmentation/Automation/Pool/PoolWorker.cpp	(revision aec09889c45d83b21d968ee2b57faa2a8c06a6c8)
@@ -52,5 +52,5 @@
  * We automatically connect to the given pool and enroll.
  *
- * @param io_service io service for creating connections
+ * @param _io_service io service for creating connections
  * @param _host host part of address of pool to connect to
  * @param _service service part of address of pool to connect to
@@ -59,16 +59,21 @@
  */
 PoolWorker::PoolWorker(
-    boost::asio::io_service& io_service,
+    boost::asio::io_service& _io_service,
     const std::string& _host,
     const std::string& _service,
     const std::string& listenhost,
     const std::string& listenservice) :
-  connection_(io_service),
-  PoolListener(io_service, boost::lexical_cast<unsigned short>(listenservice), *this),
+  io_service(_io_service),
+  PoolListener(_io_service, boost::lexical_cast<unsigned short>(listenservice), *this),
   address(listenhost, listenservice),
+  connection_(_io_service),
   enrollOp(connection_, address),
   submitOp(connection_, address),
   submitresult(boost::bind(&AsyncOperation::operator(),
       boost::ref(submitOp),
+      _host, _service)),
+  removeOp(connection_, address),
+  removeme(boost::bind(&Operation::operator(),
+      boost::ref(removeOp),
       _host, _service))
 {
@@ -138,2 +143,21 @@
   submitresult();
 }
+
+/** Helper function to shutdown the worker properly.
+ *
+ * Note that we will use ShutdownWorkerOperation to unlist from server's pool.
+ *
+ */
+void PoolWorker::shutdown(int sig)
+{
+  LOG(1, "INFO: Shutting down due to signal "+toString(sig)+".");
+
+  // remove us from pool
+  removeme();
+
+  // somehow stop listener
+  PoolListener.closeSocket();
+
+  // finally, stop io_service
+  io_service.stop();
+}
Index: src/Fragmentation/Automation/Pool/PoolWorker.hpp
===================================================================
--- src/Fragmentation/Automation/Pool/PoolWorker.hpp	(revision 9a3f84cbd399e3427447ded42db8f62d11fd2e1d)
+++ src/Fragmentation/Automation/Pool/PoolWorker.hpp	(revision aec09889c45d83b21d968ee2b57faa2a8c06a6c8)
@@ -23,4 +23,5 @@
 #include "Jobs/FragmentJob.hpp"
 #include "Controller/Commands/EnrollInPoolOperation.hpp"
+#include "Controller/Commands/RemoveFromPoolOperation.hpp"
 #include "Controller/Commands/SubmitResultOperation.hpp"
 #include "Listener.hpp"
@@ -50,4 +51,6 @@
 
   void WorkOnJob(FragmentJob::ptr &job);
+  void removeFromPool();
+  void shutdown(int sig);
 
   class PoolListener_t : public Listener
@@ -79,6 +82,6 @@
 
 private:
-  //!> The Connection to the server.
-  Connection connection_;
+  //!> reference to io_service which we use for connections
+  boost::asio::io_service& io_service;
 
   //!> The listener for the WorkerPool
@@ -87,4 +90,7 @@
   //!> address of this worker
   const WorkerAddress address;
+
+  //!> The Connection to the server for the stored operations
+  Connection connection_;
 
   //!> operation that handles obtaining a job
@@ -96,4 +102,10 @@
   //!> internally bound function such that host and service don't have to be stored, submits result
   boost::function<void ()> submitresult;
+
+  //!> operation that handles removal from pool
+  RemoveFromPoolOperation removeOp;
+
+  //!> internally bound function such that host and service don't have to be stored, submits result
+  boost::function<void ()> removeme;
 };
 
Index: src/Fragmentation/Automation/poolworker.cpp
===================================================================
--- src/Fragmentation/Automation/poolworker.cpp	(revision 9a3f84cbd399e3427447ded42db8f62d11fd2e1d)
+++ src/Fragmentation/Automation/poolworker.cpp	(revision aec09889c45d83b21d968ee2b57faa2a8c06a6c8)
@@ -29,4 +29,5 @@
 #include <iostream>
 #include <boost/lexical_cast.hpp>
+#include <signal.h>
 
 #include "atexit.hpp"
@@ -35,4 +36,12 @@
 #include "Pool/PoolWorker.hpp"
 
+boost::function<void (int)> shutdownfunction;
+
+void signalhandler(int sig)
+{
+  if (shutdownfunction)
+    shutdownfunction(sig);
+  signal(SIGINT, NULL);
+}
 
 int main(int argc, char* argv[])
@@ -56,4 +65,12 @@
     boost::asio::io_service io_service;
     PoolWorker client(io_service, argv[1], argv[2], argv[3], argv[4]);
+
+    // catch ctrl-c and shutdown worker properly
+    shutdownfunction = boost::bind(&PoolWorker::shutdown, boost::ref(client), _1);
+//    signal(SIGABRT, &signalhandler);
+//    signal(SIGTERM, &signalhandler);
+    signal(SIGINT, &signalhandler);
+
+    // process io requests
     {
       Info info("io_service");
