43cbe2de1c785a0ed22a5e6cf89cd942697afba7
[theonering] / src / util / linux.py
1 #!/usr/bin/env python
2
3
4 import logging
5
6
7 def set_process_name(name):
8         try: # change process name for killall
9            import ctypes
10            libc = ctypes.CDLL('libc.so.6')
11            libc.prctl(15, name, 0, 0, 0)
12         except Exception, e:
13            logging.warning('Unable to set processName: %s" % e')