diff --git a/lib/plugins/pidfiles.js b/lib/plugins/pidfiles.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/pidfiles.js
+++ b/lib/plugins/pidfiles.js
@@ -40,6 +40,13 @@ module.exports = function(dir, level){
   return function(master){
     dir = master.resolve(dir || 'pids');
 
-    console.log(master);
+    // save master pid
+    fs.writeFile(dir + '/master.pid', process.pid.toString(),  'ascii');
+
+    // save worker pids
+    master.on('worker', function(worker){
+      var path = dir + '/worker.' + worker.id + '.pid';
+      fs.writeFile(path, worker.proc.pid.toString(), 'ascii');
+    });
   }
 };
\ No newline at end of file
writting pidfiles