실습> kill 프로세스 강제 종료
yum은 하나만 실행할 수 있다.
1. yum 실행
yum을 실행한 후 바로 중지한다. (ctrl + z)
/dev/pts/0# yum -y install mc
:
:
[1]+ Stopped yum -y install mc
2. yum 실행
첫 번째 터미널에서 yum이 멈춰있으므로 yum 실행이 안된다.
다른 쉘에서 실행
/dev/pts/1# yum -y install mc
Loaded plugins: fastestmirror
Existing lock /var/run/yum.pid: another copy is running as pid 2794.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 33 M RSS (574 MB VSZ)
Started: Mon Nov 1 18:03:00 2021 - 00:24 ago
State : Traced/Stopped, pid: 2794
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 33 M RSS (574 MB VSZ)
Started: Mon Nov 1 18:03:00 2021 - 00:26 ago
State : Traced/Stopped, pid: 2794
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 33 M RSS (574 MB VSZ)
Started: Mon Nov 1 18:03:00 2021 - 00:28 ago
State : Traced/Stopped, pid: 2794
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 33 M RSS (574 MB VSZ)
Started: Mon Nov 1 18:03:00 2021 - 00:30 ago
State : Traced/Stopped, pid: 2794
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 33 M RSS (574 MB VSZ)
Started: Mon Nov 1 18:03:00 2021 - 00:32 ago
State : Traced/Stopped, pid: 2794
^C
3. 프로세스 확인
전체 프로세스에서 yum (문자열을 검색한다)을 실행한 PID를 확인한다.
/dev/pts/1# ps aux | grep yum
root 2794 0.0 7.0 588136 33892 pts/0 T 18:03 0:00 /usr/bin/python /usr/bin/yum -y install mc
root 2802 0.0 0.2 116972 1008 pts/1 S+ 18:08 0:00 grep --color=auto yum
4. 프로세스 종료
전체 프로세스에서 검색된 강제 PID를 종료
/dev/pts/1# kill -9 2794
/dev/pts/0# <ENTER>
[1]+ 죽었음 yum -y install mc
5. 패키지 설치
메모리에 yum이 없으므로 mc 패키지를 설치할 수 있다.
/dev/pts/1# yum -y install mc
:
:
Installed:
mc.x86_64 1:4.8.7-11.el7
Dependency Installed:
gpm-libs.x86_64 0:1.20.7-6.el7
Complete!
'Linux > Linux 실습' 카테고리의 다른 글
| [Linux] 가상 호스트 설정하기 (0) | 2021.11.09 |
|---|---|
| [Linux] HTTP Method 정리 : GET/POST 방식 (0) | 2021.11.09 |
| 사용자 크론(Cron) 생성/제거 (0) | 2021.11.06 |
| 쉘 스크립트에서 시그널 전송 막기 (0) | 2021.11.06 |
| PATH 변수에 현재 디렉터리를 설정하는 않는 경우 (0) | 2021.11.06 |