云計(jì)算學(xué)習(xí)路線課程大綱資料:使用信號(hào)控制進(jìn)程

云計(jì)算

今天給大家分享一些云計(jì)算學(xué)習(xí)路線課程大綱資料,這篇文章是關(guān)于使用信號(hào)控制進(jìn)程的一些學(xué)習(xí)筆記資料,希望能給大家一些幫助:

成都創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設(shè),高邑企業(yè)網(wǎng)站建設(shè),高邑品牌網(wǎng)站建設(shè),網(wǎng)站定制,高邑網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷,網(wǎng)絡(luò)優(yōu)化,高邑網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。

====================================================================================

kill,killall,pgrep,pkill,top

給進(jìn)程發(fā)送信號(hào)

[root@tianyun ~]# kill -l //列出所有支持的信號(hào)

編號(hào) 信號(hào)名

1) SIGHUP重新加載配置 PID不變

2) SIGINT鍵盤中斷^C

3) SIGQUIT鍵盤退出

9) SIGKILL強(qiáng)制終止

15) SIGTERM終止(正常結(jié)束),缺省信號(hào)

18) SIGCONT繼續(xù)

19) SIGSTOP停止

20)SIGTSTP暫停^Z

作業(yè)1: 給vsftpd進(jìn)程發(fā)送信號(hào)1,15

vsftpd信號(hào)測(cè)試

[root@tianyun ~]# yum -y install vsftpd

[root@tianyun ~]# systemctl start vsftpd

[root@tianyun ~]# ps aux |grep vsftpd

root 9160 0.0 0.0 52580 904 ? Ss 21:54 0:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

[root@tianyun ~]# kill -1 9160 //發(fā)送重啟信號(hào),例如vsftpd的配置文件發(fā)生改變,希望重新加載

root 9160 0.0 0.0 52580 904 ? Ss 21:54 0:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

[root@tianyun ~]# kill 9160 //發(fā)送停止信號(hào),vsftpd服務(wù)有停止的腳本 systemctl stop vsftpd

[root@tianyun ~]# ps aux |grep vsftpd

crond信號(hào)測(cè)試

//1

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ ps aux |grep [c]rond

root 478 0.0 0.1 124144 1572 ? Ss 09:35 0:00 /usr/sbin/crond -n

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ sudo kill -1 478

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ ps aux |grep [c]rond

root 478 0.0 0.1 124144 1572 ? Ss 09:35 0:00 /usr/sbin/crond -n

//15

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ sudo kill 478

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ ps aux |grep crond

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ sudo systemctl start crond

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ ps aux |grep crond

root 22319 0.0 0.1 124140 1548 ? Ss 14:54 0:00 /usr/sbin/crond -n

作業(yè)2:信號(hào)測(cè)試9,15

[root@tianyun ~]# touch file1 file2

[root@tianyun ~]# tty

/dev/pts/1

[root@tianyun ~]# vim file1

[root@tianyun ~]# tty

/dev/pts/2

[root@tianyun ~]# vim file2

[root@tianyun ~]# ps aux |grep vim

root 4362 0.0 0.2 11104 2888 pts/1 S+ 23:02 0:00 vim file1

root 4363 0.1 0.2 11068 2948 pts/2 S+ 23:02 0:00 vim file2

[root@tianyun ~]# kill 4362

[root@tianyun ~]# kill -9 4363

[root@tianyun ~]# killallvim //給所有vim進(jìn)程發(fā)送信號(hào)

[root@tianyun ~]#killall httpd

作業(yè)3:信號(hào)測(cè)試18,19

[root@tianyun ~]# ps aux |grep sshd

root 5571 0.0 0.0 64064 1164 ? Ss 09:35 0:00 /usr/sbin/sshd

[root@tianyun ~]# kill -STOP 5571

[root@tianyun ~]# ps aux |grep sshd

root 5571 0.0 0.0 64064 1164 ? Ts 09:35 0:00 /usr/sbin/sshd

[root@tianyun ~]# kill -cont 5571

[root@tianyun ~]# ps aux |grep sshd

root 5571 0.0 0.0 64064 1164 ? Ss 09:35 0:00 /usr/sbin/sshd

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ ps aux |grep crond

root 22319 0.0 0.1 124140 1568 ? Ss 14:54 0:00 /usr/sbin/crond -n

yang 22427 0.0 0.0 112648 964 pts/2 R+ 15:07 0:00 grep --color=auto crond

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ sudo kill -19 22319

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ ps aux |grep crond

root 22319 0.0 0.1 124140 1568 ? Ts 14:54 0:00 /usr/sbin/crond -n

yang 22431 0.0 0.0 112648 964 pts/2 R+ 15:07 0:00 grep --color=auto crond

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ sudo kill -cont 22319

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ ps aux |grep crond

root 22319 0.0 0.1 124140 1568 ? Ss 14:54 0:00 /usr/sbin/crond -n

yang 22436 0.0 0.0 112648 960 pts/2 R+ 15:08 0:00 grep --color=auto crond

作業(yè)4:踢出一個(gè)從遠(yuǎn)程登錄到本機(jī)的用戶

[root@tianyun ~]# pkill --help

pkill: invalid option -- '-'

Usage: pkill [-SIGNAL] [-fvx] [-n|-o] [-P PPIDLIST] [-g PGRPLIST] [-s SIDLIST]

[-u EUIDLIST] [-U UIDLIST] [-G GIDLIST] [-t TERMLIST] [PATTERN]

[root@tianyun ~]# pkill -u alice

[root@tianyun ~]# w

15:46:44 up 2:19, 4 users, load average: 0.17, 0.12, 0.08

USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

root tty1 :0 21:32 ? 4:22 4:22 /usr/bin/Xorg :

root pts/0 :0.0 15:46 0.00s 0.00s 0.00s w

root pts/3 172.16.8.100 15:46 2.00s 0.01s 0.00s sleep 50000

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ w

15:17:25 up 5:42, 3 users, load average: 0.00, 0.01, 0.05

USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

yang pts/0 123.120.22.32 15:00 21.00s 0.00s 0.00s -bash

yang pts/1 123.120.22.32 15:00 5.00s 0.00s 0.00s w

yang pts/2 123.120.22.32 12:04 13.00s 0.12s 0.02s vim file1

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ pkill -t pts/2 //終止pts/2上所有進(jìn)程

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ pkill -9 -t pts/2 //終止pts/2上所有進(jìn)程 并結(jié)束該pts/2

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ w

15:20:59 up 5:45, 3 users, load average: 0.00, 0.01, 0.05

USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

yang pts/0 123.120.22.32 15:00 3:55 0.00s 0.00s -bash

yang pts/1 123.120.22.32 15:00 3.00s 0.01s 0.00s w

yang pts/2 123.120.22.32 15:20 3.00s 0.00s 0.00s -bash

[yang@iZm5eiwihahzq6ds23gbf6Z ~]$ sudo pkill -u yang

網(wǎng)站欄目:云計(jì)算學(xué)習(xí)路線課程大綱資料:使用信號(hào)控制進(jìn)程
網(wǎng)頁(yè)地址:http://muchs.cn/article46/cjjseg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供用戶體驗(yàn)、品牌網(wǎng)站設(shè)計(jì)、服務(wù)器托管、網(wǎng)站排名移動(dòng)網(wǎng)站建設(shè)、電子商務(wù)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營(yíng)