startsrc 명령어 (AIX 5.3·6.1)

핵심 정리

  • SRC에 하위 시스템(데몬)이나 그룹, 하위 서버를 시작하라고 요청합니다.
  • startsrc -s sshd(하나), startsrc -g nfs(그룹), startsrc -t ftp(하위 서버, 예: inetd의 서비스).
  • -a "인수"로 실행 인수를, -e "변수=값 ..."로 환경 변수를 덧붙입니다. 각 문자열은 1200자까지이며 셸과 같은 규칙으로 따옴표를 처리합니다.
  • 하위 서버를 시작할 때 그 하위 시스템이 멈춰 있으면 SRC가 하위 시스템부터 시작합니다.
  • 결과는 lssrc -s 이름으로 확인합니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1 문서에 RBAC 보안 안내가 더해짐. 플래그는 같음)
원문 IBM Commands Reference — 5.3 Volume 5, 6.1 Volume 5
파일 /usr/bin/startsrc, /etc/objrepos/SRCsubsys, /etc/objrepos/SRCsubsvr
관련 명령어 stopsrc, lssrc, refresh, mkssys, srcmstr

목적

하위 시스템, 하위 시스템 그룹, 하위 서버를 시작합니다.

영어 원문

Starts a subsystem, a group of subsystems, or a subserver.

구문

하위 시스템을 시작할 때:

text
startsrc [ -a Argument ] [ -e Environment ] [ -h Host ] { -s Subsystem | -g Group }

하위 서버를 시작할 때:

text
startsrc [ -h Host ] -t Type [ -o Object ] [ -p SubsystemPID ]

설명

startsrc 명령은 시스템 자원 제어기(SRC)에 하위 시스템이나 하위 시스템 그룹을 시작하라고 요청하거나, 하위 서버를 시작하는 패킷을 하위 시스템에 전달하게 합니다.

하위 서버 시작 요청을 SRC에 보냈는데 그 하위 서버가 속한 하위 시스템이 활성 상태가 아니면, SRC는 하위 시스템을 먼저 시작하고 하위 서버 시작 요청을 하위 시스템에 전달합니다.

영어 원문

The startsrc command sends the System Resource Controller (SRC) a request to start a subsystem or a group of subsystems, or to pass on a packet to the subsystem that starts a subserver.

If a start subserver request is passed to the SRC and the subsystem to which the subserver belongs is not currently active, the SRC starts the subsystem and transmits the start subserver request to the subsystem.

플래그

플래그 설명
-a Argument 하위 시스템을 실행할 때 넘길 인수 문자열. 하위 시스템 객체 클래스에 있는 명령줄 인수 뒤에 덧붙습니다. 1200자를 넘으면 실패합니다. 셸과 같은 규칙으로 넘기므로, 따옴표로 묶은 문자열은 인수 하나가 되고 따옴표 밖의 공백은 인수를 나눕니다. 작은따옴표와 큰따옴표를 모두 쓸 수 있습니다.
-e Environment 하위 시스템을 실행할 때 환경에 넣을 문자열. 1200자를 넘으면 실패합니다. 셸과 같은 규칙으로, 따옴표로 묶은 문자열은 환경 변수 하나에 넣고 따옴표 밖의 공백은 변수를 나눕니다. 예를 들어 -e "HOME=/tmp TERM=dumb MESSAGE=\"Multiple word message\""는 HOME=/tmp, TERM=dumb, MESSAGE="Multiple word message"의 세 환경 변수를 정합니다.
-g Group 시작할 하위 시스템 그룹. 하위 시스템 객체 클래스에 없는 그룹이면 실패합니다.
-h Host 이 동작을 요청할 원격 호스트. 로컬 사용자는 root로 실행해야 합니다. 원격 시스템은 원격 SRC 요청을 받도록 구성되어 있어야 합니다. 곧 srcmstr 데몬(/etc/inittab 참고)이 -r 플래그로 시작되어 있고, /etc/hosts.equiv나 .rhosts가 원격 요청을 허용해야 합니다.
-o Object 하위 서버 객체를 문자열로 하위 시스템에 넘깁니다. Object가 올바른지는 하위 시스템이 판단합니다.
-p SubsystemPID 하위 서버 시작 요청을 보낼 하위 시스템의 특정 인스턴스.
-s Subsystem 시작할 하위 시스템. 실제 이름이나 동의어 이름을 씁니다. 하위 시스템 객체 클래스에 없으면 실패합니다.
-t Type 하위 서버를 시작합니다. 하위 서버 객체 클래스에 없는 Type이면 실패합니다.
영어 원문
  • -a Argument — Specifies an argument string that is passed to the subsystem when the subsystem is executed. This string is passed from the command line and appended to the command line arguments from the subsystem object class. The Argument string specified is a maximum of 1200 characters or the command is unsuccessful. The command argument is passed by the SRC to the subsystem, according to the same rules used by the shell. Quoted strings are passed as a single argument, and blanks outside a quoted string delimit an argument. Single and double quotes can be used.
  • -e Environment — Specifies an environment string that is placed in the subsystem environment when the subsystem is executed. The Environment string specified is a maximum of 1200 characters, or the command is unsuccessful. Using the same rules that are used by the shell, the SRC sets up the environment for the subsystem. Quoted strings are assigned to a single environment variable and blanks outside quoted strings delimit each environment variable to be set. For example: -e "HOME=/tmp TERM=dumb MESSAGE=\"Multiple word message\""would set HOME=/tmp as the first, TERM=dumb as the second, and MESSAGE="Multiple word message" as the third environment variable for the subsystem.
  • -g Group — Specifies a group of subsystems to be started. The command is unsuccessful if the Group name is not contained in the subsystem object class.
  • -h Host — Specifies the foreign host on which this start 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 -r flag and the /etc/hosts.equiv or .rhosts file must be configured to allow remote requests.
  • -o Object — Specifies that a subserver object is to be passed to the subsystem as a character string. It is the subsystems responsibility to determine the validity of the Object string.
  • -p SubsystemPID — Specifies a particular instance of the subsystem to which the start subserver request is to be passed.
  • -s Subsystem — Specifies a subsystem to be started. The Subsystem can be the actual subsystem name or the synonym name for the subsystem. The command is unsuccessful if the Subsystem is not contained in the subsystem object class.
  • -t Type — Specifies that a subserver is to be started. The command is unsuccessful if Type is not contained in 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.

예제

  1. 인수와 환경 변수를 주어 하위 시스템을 시작합니다. srctest 하위 시스템을 환경 변수 TERM=dumb, HOME=/tmp와 두 인수 -D, DEBUG로 시작합니다.
bash
startsrc -s srctest -a "-D DEBUG" -e "TERM=dumb HOME=/tmp"
  1. 원격 호스트 zork에서 tcpip 그룹의 모든 하위 시스템을 시작합니다.
bash
startsrc -g tcpip -h zork
  1. tester 하위 서버를 가진 하위 시스템에 하위 서버 시작 요청을 보냅니다.
bash
startsrc -t tester
  1. 명령 인수를 주어 하위 시스템을 시작합니다. srctest에 -a, 123, -b, 4 5 6의 네 인수를 넘깁니다.
bash
startsrc -s srctest -a "-a 123 -b \"4 5 6\""

자주 쓰는 형태:

bash
startsrc -s sshd                 # sshd 시작
startsrc -g nfs                  # NFS 관련 데몬 모두 시작
startsrc -s syslogd; lssrc -s syslogd
영어 원문
  1. To start a subsystem with arguments and environment variables, enter:
startsrc -s srctest -a "-D DEBUG" -e "TERM=dumb HOME=/tmp"

This starts the srctest subsystem with "TERM=dumb", "HOME=/tmp" in its environment and "-D DEBUG" as two arguments to the subsystem.

  1. To start a subsystem group on a foreign host, enter:
startsrc -g tcpip -h zork

This starts all the subsystems in the subsystem tcpip group on the zork machine.

  1. To start a subserver, enter:
startsrc -t tester

This sends a start subserver request to the subsystem that owns the tester subsystem.

  1. To start a subsystem with command arguments, enter:
startsrc -s srctest -a "-a 123 -b \"4 5 6\""

This places "-a" as the first argument, "123" as the second, "-b" as the third, and"456" as the fourth argument to the srctest subsystem.

파일

파일 설명
/etc/objrepos/SRCsubsys SRC 하위 시스템 구성 객체 클래스
/etc/objrepos/SRCsubsvr 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/services — Defines the sockets and protocols used for Internet services.
  • /dev/SRC — Specifies the AF_UNIX socket file.
  • /dev/.SRC-unix — Specifies the location for temporary socket files.

Related reference:

  • stopsrc Command

Related information:

  • refresh command
  • System resource controller
  • RBAC in AIX Version 7.1 Security
  • Trusted AIX®

리눅스(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이나 여러 단위를 한 번에 지정하는 것으로 대신합니다.