lssrc 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-lssrc
핵심 정리
- 시스템 자원 제어기(SRC, System Resource Controller)에 하위 시스템(데몬)의 상태를 물어봅니다.
lssrc -a(모든 하위 시스템),lssrc -g tcpip(그룹),lssrc -s sshd(하나),lssrc -l -s 이름(긴 상태, 하위 시스템이 직접 답함).- 출력 열은 Subsystem, Group, PID, Status(active, inoperative 등)입니다.
-h 호스트로 원격 시스템의 상태도 볼 수 있지만, 원격의srcmstr가-r로 떠 있어야 합니다.- 하위 시스템을 멈추지 않고
mkssys·chssys로 바꾸면 같은 데몬이 active와 inoperative 두 줄로 보일 수 있습니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1 문서에 RBAC 보안 안내가 더해짐. 플래그는 같음) |
| 원문 | IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3 |
| 파일 | /usr/bin/lssrc, /etc/objrepos/SRCsubsys, /etc/objrepos/SRCsubsvr, /etc/objrepos/SRCnotify |
| 관련 명령어 | startsrc, stopsrc, refresh, mkssys, chssys, rmssys, srcmstr |
목적
하위 시스템, 하위 시스템 그룹, 하위 서버의 상태를 가져옵니다.
영어 원문
Gets the status of a subsystem, a group of subsystems, or a subserver.
구문
모든 상태:
lssrc [ -h Host ] -a
그룹 상태:
lssrc [ -h Host ] -g GroupName
하위 시스템 상태:
lssrc [ -h Host ] [ -l ] -s Subsystem
PID로 상태:
lssrc [ -h Host ] [ -l ] -p SubsystemPID
하위 서버 상태:
lssrc [ -h Host ] [ -l ] -t Type [ -p SubsystemPID ] [ -o Object ] [ -P SubserverPID ]
하위 시스템 상태를 SMIT 형식으로:
lssrc -S [ -s Subsystem | -d ]
하위 서버 상태를 SMIT 형식으로:
lssrc -T [ -t Type ]
통지(notify)를 SMIT 형식으로:
lssrc -N [ -n NotifyName ]
설명
lssrc 명령은 시스템 자원 제어기(SRC)에 하위 시스템, 하위 시스템 그룹, 또는 모든 하위 시스템의 상태를 요청합니다. 하위 서버 상태나 하위 시스템의 긴 상태를 요청하면 하위 시스템 요청 패킷을 데몬에 보내 하위 시스템에 전달하게 합니다.
하위 서버에 대해 짧은 상태와 긴 상태 중 고를 수 있습니다. -l이 없으면 짧은 상태로 봅니다. 하위 시스템, 그룹, 모든 하위 시스템의 짧은 상태는 SRC가 직접 처리합니다.
하위 시스템에 -l을 주면 상태 요청을 하위 시스템에 보내고 하위 시스템이 상태를 돌려줍니다. -l은 통신 방법으로 신호(signal)를 쓰지 않는 하위 시스템에서만 지원합니다. 하위 서버는 짧은 상태든 긴 상태든 하위 시스템에 상태 요청 패킷을 보내고 하위 시스템이 답합니다.
lssrc 출력에 한 데몬이 두 줄로 나올 때가 있습니다. 하나는 active, 다른 하나는 inoperative입니다. 하위 시스템을 멈추지 않고 mkssys나 chssys로 바꾸면 이렇게 됩니다. 원래 하위 시스템은 계속 active이고, 바뀐 것은 하위 시스템을 멈췄다가 다시 시작할 때까지 inoperative입니다.
영어 원문
The lssrc command sends a request to the System Resource Controller to get status on a subsystem, a group of subsystems, or all subsystems. The lssrc command sends a subsystem request packet to the daemon to be forwarded to the subsystem for a subserver status or a long subsystem status.
You can choose whether to request a short or long status for a subserver. When the -l flag is absent, the status request is assumed to be a short status. A short status of a subsystem, group of subsystems, or all subsystems is handled by the System Resource Controller.
When the -l flag is present for a subsystem, a status request is taken to the subsystem and the subsystem sends the status back. The -l flag is supported only for those subsystems not using signals as their communication method. For either a long or short status of a subserver, the subsystem is sent a status request packet, and the subsystem sends the status back.
The lssrc command output can sometimes show two entries for a particular daemon. One instance will be active and another instance will be inoperative. This can happen if the subsystem is modified (using the mkssys command or chssys command) without stopping the subsystem. The original subsystem will remain active and the modified instance will be inoperative until the subsystem is stopped and started again.
플래그
| 플래그 | 설명 |
|---|---|
-a |
정의된 모든 하위 시스템의 현재 상태를 나열합니다. |
-d |
기본 레코드를 출력합니다. |
-g GroupName |
상태를 볼 하위 시스템 그룹. 하위 시스템 객체 클래스에 없는 그룹이면 실패합니다. |
-h Host |
이 동작을 요청할 원격 호스트. 로컬 사용자는 root로 실행해야 합니다. 원격 시스템은 원격 SRC 요청을 받도록 구성되어 있어야 합니다. 곧 srcmstr 데몬(/etc/inittab 참고)이 -r 플래그로 시작되어 있고, /etc/hosts.equiv나 .rhosts가 원격 요청을 허용해야 합니다. |
-l |
하위 시스템이 현재 상태를 긴 형식으로 보내게 합니다. 하위 시스템에 상태 요청을 보내야 하며, 상태를 돌려주는 것은 하위 시스템의 몫입니다. |
-n NotifyName |
통지 메서드 이름. |
-N |
통지 객체 클래스의 ODM 레코드를 SMIT 형식으로 출력합니다. |
-o Object |
하위 서버 Object를 문자열로 하위 시스템에 넘깁니다. |
-p SubsystemPID |
상태를 볼 하위 시스템의 특정 인스턴스, 또는 하위 서버 상태 요청을 보낼 하위 시스템 인스턴스. |
-P SubserverPID |
SubserverPID를 문자열로 하위 시스템에 넘깁니다. |
-s Subsystem |
상태를 볼 하위 시스템. 실제 이름이나 동의어 이름을 씁니다. 하위 시스템 객체 클래스에 없으면 실패합니다. |
-S |
하위 시스템 객체 클래스의 ODM 레코드를 SMIT 형식으로 출력합니다. |
-t Type |
하위 시스템에 하위 서버의 현재 상태를 보내게 합니다. 하위 서버 객체 클래스에 없는 Type이면 실패합니다. |
-T |
하위 서버 객체 클래스의 ODM 레코드를 SMIT 형식으로 출력합니다. |
영어 원문
-a— Lists the current status of all defined subsystem.-d— Specifies that the default record is printed.-gGroupName — Specifies a group of subsystems to get status for. The command is unsuccessful if the GroupName variable is not contained in the subsystem object class.-hHost — Specifies the foreign host on which this status action is requested. The local user must be running as "root". The remote system must be configured to accept remote System Resource Controller requests. That is, the srcmstr daemon (see /etc/inittab) must be started with the-rflag and the /etc/hosts.equiv or .rhosts file must be configured to allow remote requests.-l— Requests that a subsystem send its current status in long form. Long status requires that a status request be sent to the subsystem; it is the responsibility of the subsystem to return the status.-nNotifyName — Specifies the name of a notify method.-N— Specifies that the Object Data Manager (ODM) records are output in SMIT format for the notify object class.-oObject — Specifies that a subserver Object variable is passed to the subsystem as a character string.-pSubsystemPID — Specifies a particular instance of the SubsystemPID variable to get status for, or a particular instance of the subsystem to which the status subserver request is to be taken.-PSubserverPID — Specifies that a SubserverPID variable is to be passed to the subsystem as a character string.-sSubsystem — Specifies a subsystem to get status for. The Subsystem variable can be the actual subsystem name or the synonym name for the subsystem. The command is unsuccessful if the Subsystem variable is not contained in the subsystem object class.-S— Specifies that the ODM records are output in SMIT format for the subsystem object class.-tType — Requests that a subsystem send the current status of a subserver. The command is unsuccessful if the subserver Type variable is not contained in the subserver object class.-T— Specifies that the ODM records are output in SMIT format for the subserver object class.
보안
RBAC 사용자와 Trusted AIX 사용자는 주의하세요. 이 명령은 특권 작업을 할 수 있으며, 특권 작업은 특권 사용자만 할 수 있습니다. 특권과 권한 목록은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다(6.1 문서에만 있음).
영어 원문
Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.
Exit status
| 값 | 뜻 |
|---|---|
| 0 | 성공 |
| 1 | 실패 |
영어 원문
0 The command ran successfully.
1 The command failed.
예제
| 명령 | 하는 일 |
|---|---|
lssrc -a |
로컬 머신에 알려진 모든 하위 시스템의 상태 |
lssrc -h zork -a |
원격 호스트 zork의 모든 하위 시스템 상태 |
lssrc -s srctest |
로컬 머신의 srctest 하위 시스템의 모든 인스턴스 상태 |
lssrc -p 1234 |
PID가 1234인 하위 시스템의 상태 |
lssrc -g tcpip |
tcpip 그룹에 속한 모든 하위 시스템의 상태 |
lssrc -t tester -p 1234 |
PID 1234인 srctest 하위 시스템에 속한 tester 하위 서버의 상태 |
lssrc -l -p 1234 |
PID 1234인 하위 시스템의 긴 상태 |
출력 예:
Subsystem Group PID Status
syslogd ras 3932356 active
sendmail mail 3407998 active
inetd tcpip 3080254 active
snmpd tcpip inoperative
자주 쓰는 형태:
lssrc -a | grep -v active # 멈춰 있는 하위 시스템
lssrc -s sshd # sshd 상태
lssrc -l -s inetd # inetd가 관리하는 서비스까지(긴 상태)
lssrc -ls xntpd # NTP 동기화 상태
영어 원문
- To get the status of all subsystems on the local machine, enter:
lssrc -a
This gets the status of all subsystems known on the local machine.
- To get the status of all subsystems on a foreign host, enter:
lssrc -h zork -a
This gets the status of all subsystems known on the zork machine.
- To get the status of the srctest subsystem, enter:
lssrc -s srctest
This gets the status of all instances of the srctest subsystem on the local machine.
- To get the status of the subsystem by PID, enter:
lssrc -p 1234
This gets the status of the subsystem with the subsystem PID of 1234 on the local machine.
- To get the status of the
tcpipsubsystem group, enter:
lssrc -g tcpip
This gets the status of all instances of subsystems in the tcpip group on the local machine.
- To get the status of the
testersubserver, enter:
lssrc -t tester -p 1234
|
|
|
This gets the status of tester subserver that belongs to the srctest subsystem with the subsystem PID of 1234 on the local machine.
- To get the status of the subsystem by PID, enter:
lssrc -l -p 1234
This gets the long status of the subsystem with the PID of 1234.
파일
| 파일 | 설명 |
|---|---|
/etc/objrepos/SRCsubsys |
SRC 하위 시스템 구성 객체 클래스 |
/etc/objrepos/SRCsubsvr |
SRC 하위 서버 구성 객체 클래스 |
/etc/objrepos/SRCnotify |
SRC 통지 구성 객체 클래스 |
/etc/services |
인터넷 서비스가 쓰는 소켓과 프로토콜 정의 |
/dev/SRC |
AF_UNIX 소켓 파일 |
/dev/.SRC-unix |
임시 소켓 파일의 위치 |
영어 원문
- /etc/objrepos/SRCsubsys — Specifies the SRC Subsystem Configuration Object Class.
- /etc/objrepos/SRCsubsvr — Specifies the SRC Subserver Configuration Object Class.
- /etc/objrepos/SRCnotify — Specifies the SRC Notify Configuration Object Class.
- /etc/services — Defines the sockets and protocols used for Internet services.
- /dev/SRC — Specifies the
AF_UNIXsocket file. - /dev/.SRC-unix — Specifies the location for temporary socket files.
Related reference:
- mkssys Command
Related information:
- rmssys command
- System Resource Controller
리눅스(GNU)와 다른 점
리눅스에서 SRC에 해당하는 것은 systemd입니다. lssrc -a는 systemctl list-units --type=service, lssrc -s 이름은 systemctl status 이름, startsrc -s·stopsrc -s는 systemctl start·stop, refresh -s는 systemctl reload에 가깝습니다. 하위 시스템 그룹(-g tcpip)은 systemd의 target이나 여러 단위를 한 번에 지정하는 것으로 대신합니다.