Pra*_*uru 38 root user-accounts command-line ubuntu
如何nginx
在 Ubuntu 中检查守护进程的用户和组?
或者为在 Ubuntu 中运行的守护进程查找用户和组的语法是什么?
Der*_*ler 44
只需ps
在运行时使用:
oliver@ubuntuServer:~$ ps aux|grep nginx|grep -v grep
root 17119 0.0 0.1 57492 1156 ? Ss 14:22 0:00 nginx: master process /usr/sbin/nginx
www-data 17120 0.0 0.1 57804 1572 ? S 14:22 0:00 nginx: worker process
www-data 17121 0.0 0.1 57804 1572 ? S 14:22 0:00 nginx: worker process
www-data 17122 0.0 0.1 57804 1572 ? S 14:22 0:00 nginx: worker process
www-data 17123 0.0 0.1 57804 1572 ? S 14:22 0:00 nginx: worker process
Run Code Online (Sandbox Code Playgroud)
正如您在第一列中看到的,初始 nginx 主进程是使用root
用户帐户启动的。此过程将在www-data
用户帐户下生成工作人员。这将是你关心的那个。
如果nginx
未运行,您也可以从配置文件中提取信息,如下所示:
oliver@ubuntuServer:~$ grep user /etc/nginx/nginx.conf
user www-data;
Run Code Online (Sandbox Code Playgroud)
小智 19
要回答正在运行的进程的问题的“和组”部分,也请使用 supgrp(补充组的名称)格式说明符。尝试:
ps -eo pid,comm,euser,supgrp | grep nginx
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
70299 次 |
最近记录: |