티스토리 뷰
3. 다음은 프로세스 우선순위에 관한 명령어이다.
( 괄호 ) 안에 알맞은 명령어를 넣으시오.
[root@ihd ~]# ps -l
FS UID PID PPID CPRI NI ADDRSZWCHAN TTY TIMECMD
4S 0 3320 3318 0 80 0-27121wait pts/0 00:00:00bash
0T 0 3486 3320 0 80 0- 3200signal pts/0 00:00:00command
4R 0 3499 3320 0 80 0-27036- pts/0 00:00:00ps
[root@ihd ~]# ( 괄호 ) -19 3486
3486: old priority 0, new priority -19
[root@ihd ~]# ps -l
FS UID PID PPID CPRI NI ADDRSZWCHAN TTY TIMECMD
4S 0 3320 3318 0 80 0-27121wait pts/0 00:00:00bash
0T 0 3486 3320 0 61-19- 3200signal pts/0 00:00:00command
4R 0 3501 3320 0 80 0-27034- pts/0 00:00:00ps
■ 조건
- PID 3486 인 command 라는 프로세스의
우선순위를 변경한다.
- 기존 우선순위 0에서 -19로 우선순위를
조정한다.
정답 : renice
- PID를 통해 우선순위를 조정한다.
(사용자명, 그룹ID로도 가능)
#풀이 방법
renice 명령어를 몰랐다 하더라도 아래와 같이 우선순위 관련 영단어로 검색하면 찾을 수 있다.
order, priority등..
root@PSDEV:/root] man -k prior
sched_get_priority_max (2) - 정적 선행 범위를 가진다.
sched_get_priority_min (2) - 정적 선행 범위를 가진다.
pthread_setschedprio (3) - set scheduling priority of a thread
function::task_prio (3stap) - The priority value of the task
getpriority (2) - get/set program scheduling priority
getpriority (3p) - get and set the nice value
ionice (1) - set or get process I/O scheduling class and priority
ioprio_get (2) - get/set I/O scheduling class and priority
ioprio_set (2) - get/set I/O scheduling class and priority
nice (1) - run a program with modified scheduling priority
nice (2) - change process priority
pthread_mutex_getprioceiling (3p) - get and set the priority ceiling of a mutex (REALTIME THREADS)
pthread_mutex_setprioceiling (3p) - get and set the priority ceiling of a mutex (REALTIME THREADS)
renice (1) - alter priority of running processes
sched_get_priority_max (3p) - get priority limits (REALTIME)
sched_get_priority_min (3p) - get priority limits (REALTIME)
setlogmask (3) - set log priority mask
setpriority (2) - get/set program scheduling priority
setpriority (3p) - get and set the nice value
tc-prio (8) - Priority qdisc
RENICE(1) User Commands RENICE(1)
NAME
renice - alter priority of running processes
SYNOPSIS
renice [-n] priority [-gpu] identifier...
DESCRIPTION
renice alters the scheduling priority of one or more running processes. The first argument is the priority value to be used. The other arguments are interpreted as process IDs (by default), process group IDs, user IDs, or user names.
renice'ing a process group causes all processes in the process group to have their scheduling priority altered. renice'ing a user causes all processes owned by the user to have their scheduling priority altered.
OPTIONS
-n, --priority priority
Specify the scheduling priority to be used for the process, process group, or user. Use of the option -n or --priority is optional, but when used it must be the first argument.
-g, --pgrp pgid...
Force the succeeding arguments to be interpreted as process group IDs.
-u, --user name_or_uid...
Force the succeeding arguments to be interpreted as usernames or UIDs.
-p, --pid pid...
Force the succeeding arguments to be interpreted as process IDs (the default).
-h, --help
Display a help text.
-V, --version
Display version information.
'IT > 리눅스 마스터 1급' 카테고리의 다른 글
rsyslog.conf 설정 간단정리 (구문법 설명) (0) | 2021.10.24 |
---|---|
fstab 파일 설정 간단정리(예시/ 각 필드의 의미) (0) | 2021.10.23 |
rmmod 명령어 간단정리 (의존성/ 옵션정리/ 예시설명) (0) | 2021.10.21 |
리눅스 패키지 설치: rpm명령어 간단정리 (예시 포함) (0) | 2021.10.21 |
fdisk 명령어 초간단 정리 (파티션 타입 83,8e/ LVM파티션) (0) | 2021.10.21 |