为什么我杀了apache用户,但它仍然显示?

为什么我杀了apache用户,但它仍然显示?

我正在使用 CentOS 7、Nginx,我不想使用 Apache httpd。然后我杀死用户apache

pkill -9 -u apache
pkill -KILL -u apache

然后我再次检查,我仍然看到 user apache。如何杀死与用户相关的所有进程apache?我也想杀死 的进程php-fpm

[root@VMHostDefault nginx]# ps aux
USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root          1  0.0  0.1 191028  2128 ?        Ss   Apr24   1:47 /usr/lib/systemd/systemd --system --deserialize 18
root          2  0.0  0.0      0     0 ?        S    Apr24   0:00 [kthreadd]
root          3  0.0  0.0      0     0 ?        S    Apr24   0:55 [ksoftirqd/0]
root          5  0.0  0.0      0     0 ?        S<   Apr24   0:00 [kworker/0:0H]
root          7  0.0  0.0      0     0 ?        S    Apr24   0:00 [migration/0]
root          8  0.0  0.0      0     0 ?        S    Apr24   0:00 [rcu_bh]
root          9  0.0  0.0      0     0 ?        R    Apr24   4:59 [rcu_sched]
root         10  0.0  0.0      0     0 ?        S<   Apr24   0:00 [lru-add-drain]
root         11  0.0  0.0      0     0 ?        S    Apr24   0:10 [watchdog/0]
root         13  0.0  0.0      0     0 ?        S    Apr24   0:00 [kdevtmpfs]
root         14  0.0  0.0      0     0 ?        S<   Apr24   0:00 [netns]
root         15  0.0  0.0      0     0 ?        S    Apr24   0:01 [khungtaskd]
root         16  0.0  0.0      0     0 ?        S<   Apr24   0:00 [writeback]
root         17  0.0  0.0      0     0 ?        S<   Apr24   0:00 [kintegrityd]
root         18  0.0  0.0      0     0 ?        S<   Apr24   0:00 [bioset]
root         19  0.0  0.0      0     0 ?        S<   Apr24   0:00 [bioset]
root         20  0.0  0.0      0     0 ?        S<   Apr24   0:00 [bioset]
root         21  0.0  0.0      0     0 ?        S<   Apr24   0:00 [kblockd]
root         22  0.0  0.0      0     0 ?        S<   Apr24   0:00 [md]
root         23  0.0  0.0      0     0 ?        S<   Apr24   0:00 [edac-poller]
root         24  0.0  0.0      0     0 ?        S<   Apr24   0:00 [watchdogd]
root         30  0.0  0.0      0     0 ?        S    Apr24   0:32 [kswapd0]
root         31  0.0  0.0      0     0 ?        SN   Apr24   0:00 [ksmd]
root         32  0.0  0.0      0     0 ?        SN   Apr24   0:10 [khugepaged]
root         33  0.0  0.0      0     0 ?        S<   Apr24   0:00 [crypto]
root         41  0.0  0.0      0     0 ?        S<   Apr24   0:00 [kthrotld]
root         43  0.0  0.0      0     0 ?        S<   Apr24   0:00 [kmpath_rdacd]
root         44  0.0  0.0      0     0 ?        S<   Apr24   0:00 [kaluad]
root         45  0.0  0.0      0     0 ?        S<   Apr24   0:00 [kpsmoused]
root         47  0.0  0.0      0     0 ?        S<   Apr24   0:00 [ipv6_addrconf]
root         60  0.0  0.0      0     0 ?        S<   Apr24   0:00 [deferwq]
root         91  0.0  0.0      0     0 ?        S    Apr24   0:18 [kauditd]
root       1699  0.0  0.0      0     0 ?        S<   Apr24   0:00 [nfit]
root       1716  0.0  0.0      0     0 ?        S<   Apr24   0:00 [ata_sff]
root       1741  0.0  0.0      0     0 ?        S<   Apr24   0:00 [mpt_poll_0]
root       1743  0.0  0.0      0     0 ?        S<   Apr24   0:00 [mpt/0]
root       1775  0.0  0.0      0     0 ?        S    Apr24   0:00 [scsi_eh_0]
root       1778  0.0  0.0      0     0 ?        S<   Apr24   0:00 [scsi_tmf_0]
root       1795  0.0  0.0      0     0 ?        S    Apr24   0:00 [scsi_eh_1]
root       1797  0.0  0.0      0     0 ?        S<   Apr24   0:00 [scsi_tmf_1]
root       1799  0.0  0.0      0     0 ?        S    Apr24   0:00 [scsi_eh_2]
root       1807  0.0  0.0      0     0 ?        S<   Apr24   0:00 [scsi_tmf_2]
root       2037  0.0  0.0      0     0 ?        S<   Apr24   0:00 [ttm_swap]
root       2044  0.0  0.0      0     0 ?        S    Apr24   0:00 [irq/16-vmwgfx]
root       2933  0.0  0.0      0     0 ?        S<   Apr24   0:00 [kdmflush]
root       2934  0.0  0.0      0     0 ?        S<   Apr24   0:00 [bioset]
root       2947  0.0  0.0      0     0 ?        S<   Apr24   0:00 [kdmflush]
root       2948  0.0  0.0      0     0 ?        S<   Apr24   0:00 [bioset]
root       2967  0.0  0.0      0     0 ?        S<   Apr24   0:00 [bioset]
root       2972  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfsalloc]
root       2975  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs_mru_cache]
root       2978  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-buf/dm-0]
root       2983  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-data/dm-0]
root       2986  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-conv/dm-0]
root       2987  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-cil/dm-0]
root       2988  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-reclaim/dm-]
root       2989  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-log/dm-0]
root       2990  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-eofblocks/d]
root       2991  0.0  0.0      0     0 ?        S    Apr24   8:35 [xfsaild/dm-0]
root       2992  0.0  0.0      0     0 ?        S<   Apr24   0:09 [kworker/0:1H]
root       3060  0.0  0.2  39084  3856 ?        Ss   Apr24   9:55 /usr/lib/systemd/systemd-journald
root       4947  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-buf/sda1]
root       4952  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-data/sda1]
root       4954  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-conv/sda1]
root       4961  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-cil/sda1]
root       4971  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-reclaim/sda]
root       4975  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-log/sda1]
root       4981  0.0  0.0      0     0 ?        S<   Apr24   0:00 [xfs-eofblocks/s]
root       4987  0.0  0.0      0     0 ?        S    Apr24   0:00 [xfsaild/sda1]
root       6321  0.0  0.0  55520   128 ?        S<sl Apr24   2:09 /sbin/auditd
root       6343  0.0  0.0  26856   476 ?        Ss   Apr24   0:16 /usr/lib/systemd/systemd-logind
dbus       6344  0.0  0.0  60428   472 ?        Ss   Apr24   0:45 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
polkitd    6346  0.0  0.0 615420     0 ?        Ssl  Apr24   0:00 /usr/lib/polkit-1/polkitd --no-debug
root       6385  0.0  0.0 126320    88 ?        Ss   Apr24   0:03 /usr/sbin/crond -n
root       6387  0.0  0.0 110104    16 tty1     Ss+  Apr24   0:00 /sbin/agetty --noclear tty1 linux
root       6396  0.0  0.0 369660    16 ?        Ssl  Apr24   0:03 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
root       6415  0.0  0.0 221428  1344 ?        Ss   Apr24   6:24 /usr/bin/python /usr/bin/supervisord -c /etc/supervisord.conf
root       6480  0.0  0.0 474580   292 ?        Ssl  Apr24   0:30 /usr/sbin/NetworkManager --no-daemon
root       6529  0.1  0.1 262592  2004 ?        Sl   Apr24  26:30 /usr/sbin/vmtoolsd
root       6605  0.0  0.0  66396     4 ?        S    Apr24   0:00 /usr/lib/vmware-vgauth/VGAuthService -s
root       6706  0.0  0.0 506052   932 ?        Sl   Apr24  14:47 //usr/lib/vmware-caf/pme/bin/ManagementAgentHost
root       7046  0.0  0.0 573924   536 ?        Ssl  Apr24   3:40 /usr/bin/python2 -Es /usr/sbin/tuned -l -P
root       7047  0.0  0.0 112864   364 ?        Ss   Apr24   2:27 /usr/sbin/sshd -D
root       7050  0.0  0.6 308648 11808 ?        Ssl  Apr24   5:16 /usr/sbin/rsyslogd -n
root       7137  0.0  0.0 128404   436 ?        Ss   Apr24   0:00 nginx: master process /usr/sbin/nginx
root       8550  0.0  0.0 159500   176 ?        Ss   22:39   0:00 sshd: root@notty
root       8554  0.0  0.0  72200    84 ?        Ss   22:39   0:00 /usr/libexec/openssh/sftp-server
root       8649  0.0  0.0  72200     0 ?        Ss   22:41   0:00 /usr/libexec/openssh/sftp-server
root       8650  0.0  0.0  72200     0 ?        Ss   22:41   0:00 /usr/libexec/openssh/sftp-server
root       8681  0.0  0.0 159360   404 ?        Ss   22:42   0:00 sshd: root@pts/0
root       8683  0.0  0.0 115572  1144 pts/0    Ss   22:42   0:00 -bash
root       9502  0.0  0.0      0     0 ?        R    22:56   0:00 [kworker/0:2]
root       9973  0.0  0.0      0     0 ?        S    23:05   0:00 [kworker/0:1]
root      10242  0.0  0.0      0     0 ?        S    23:10   0:00 [kworker/0:0]
root      10439  0.0  0.0      0     0 ?        S    23:13   0:00 [kworker/0:3]
apache    10550  0.5  1.7 351404 32844 ?        S    23:14   0:00 php-fpm: pool www
apache    10551  0.9  2.3 362028 43088 ?        S    23:14   0:00 php-fpm: pool www
apache    10552  0.7  1.8 435116 34684 ?        S    23:14   0:00 php-fpm: pool www
apache    10553  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10554  1.1  2.4 364076 45576 ?        S    23:14   0:01 php-fpm: pool www
apache    10555  0.0  0.2 326152  5244 ?        S    23:14   0:00 php-fpm: pool www
apache    10556  0.5  1.5 349356 29344 ?        S    23:14   0:00 php-fpm: pool www
apache    10557  0.9  2.3 362160 43264 ?        S    23:14   0:01 php-fpm: pool www
apache    10558  0.0  0.2 326152  5244 ?        S    23:14   0:00 php-fpm: pool www
apache    10559  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10560  0.6  1.8 353580 33836 ?        S    23:14   0:00 php-fpm: pool www
apache    10561  1.1  2.5 447788 47580 ?        S    23:14   0:01 php-fpm: pool www
apache    10562  0.0  0.2 326152  5244 ?        S    23:14   0:00 php-fpm: pool www
apache    10563  0.5  1.5 349356 29348 ?        S    23:14   0:00 php-fpm: pool www
apache    10564  0.0  0.2 326152  5244 ?        S    23:14   0:00 php-fpm: pool www
apache    10565  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10566  0.9  2.3 364076 43800 ?        S    23:14   0:01 php-fpm: pool www
apache    10567  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10568  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10569  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10570  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10571  0.0  0.1 325992  3008 ?        S    23:14   0:00 php-fpm: pool www
apache    10572  0.0  0.1 325992  3008 ?        S    23:14   0:00 php-fpm: pool www
apache    10573  0.0  0.1 325992  3008 ?        S    23:14   0:00 php-fpm: pool www
apache    10574  0.0  0.1 325992  3008 ?        S    23:14   0:00 php-fpm: pool www
apache    10575  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10576  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10577  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10578  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10579  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10580  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10581  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10582  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10583  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
apache    10584  0.0  0.1 325992  3012 ?        S    23:14   0:00 php-fpm: pool www
root      10685  0.0  0.1 155360  1892 pts/0    R+   23:16   0:00 ps aux
root      54324  0.0  0.0      0     0 ?        S    May10   0:02 [kworker/u256:0]
root      78739  0.0  0.0  44416    32 ?        Ss   May02   0:00 /usr/lib/systemd/systemd-udevd
root      87367  0.0  0.2 2992872 4436 ?        SLl  May05   1:49 dotnet run
root      87449  0.0  0.9 7118604 17816 ?       SLl  May05   6:06 dotnet exec /home/bkitvn/bkitvn/bin/Debug/netcoreapp2.2/bkitvn.dll
root      94573  0.0  0.0 124824     0 ?        Ss   May02   0:00 /usr/sbin/lvmetad -f
mysql     94626  0.0  0.0 113312    24 ?        Ss   May02   0:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
mysql     94855  0.0  4.0 1000760 76096 ?       Sl   May02  10:51 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plug
root      94904  0.0  0.0 323908  1712 ?        Ss   May02   0:58 php-fpm: master process (/etc/php-fpm.conf)
nginx    126460  0.0  0.2 131192  3864 ?        S    18:24   0:03 nginx: worker process
ntp      129453  0.0  0.0  32028   452 ?        Ss   19:17   0:00 /usr/sbin/ntpd -u ntp:ntp -g
root     129454  0.0  0.0      0     0 ?        S    19:17   0:00 [kworker/u256:1]
[root@VMHostDefault nginx]# 

答案1

跑步

yum remove httpd
yum erase httpd httpd-tools apr apr-util

答案2

试试这个命令

# ps auxw | awk '/[a]pache/{print $2}' | xargs kill -9

相关内容