MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / get_process_username

Method get_process_username

class/process_task.py:530–540  ·  view source on GitHub ↗

@name 获取进程用户名 @param pid 进程id @return 用户名

(self, pid)

Source from the content-addressed store, hash-verified

528 return up, up_package, down, down_package
529
530 def get_process_username(self, pid):
531 '''
532 @name 获取进程用户名
533 @param pid 进程id
534 @return 用户名
535 '''
536 try:
537 import pwd
538 return pwd.getpwuid(os.stat('/proc/' + str(pid)).st_uid).pw_name
539 except:
540 return 'root'
541
542 def get_monitor_list(self, stime=None):
543 '''

Callers 1

get_monitor_listMethod · 0.95

Calls 1

statMethod · 0.80

Tested by

no test coverage detected