import protocol
import queue
+import util
from errors import *
def run(self):
self.log.info("Starting interface %s" % self.dev)
+ util.setprocname("interface %s" % self.dev)
+
self.db.open()
p = pcapy.open_live(self.dev, self.mtu, self.promisc, 0)
from threading import Thread
+import util
+
from errors import *
class Queue(Thread):
def run(self):
self.log.debug("Started event queue")
+ util.setprocname("queue")
+
while self.__running or self.__queue:
if not self.__queue:
#self.log.debug("Queue sleeping for %s seconds" % self.heartbeat)
--- /dev/null
+#!/bin/bash
+###############################################################################
+# #
+# Cappie #
+# Copyright (C) 2010 Michael Tremer #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+import ctypes
+
+def setprocname(name):
+ libc = ctypes.cdll.LoadLibrary(None)
+
+ buff = ctypes.create_string_buffer(len(name)+1)
+ buff.value = name
+
+ libc.prctl(15, ctypes.byref(buff), 0, 0, 0)