- smf(service management facility)
// 개념
smf (service management facility)
- 서비스를 실행이나 종료를 제공하기 위한 프로그램 모델
- 서비스 인스턴스는 상태는 enable 또는 disable 등으로 표시된다.
- 모든 서비스들은 svcadm 명령어로 enable 또는 disable 될 수 있다.
- 시스템에서 관리되는 서비스 인스턴스의 list 들은 svcs 명령어로 확인할 수 있다.
- 서비스 인스턴스들은 서비스에 종속되거나 파일에 종속될 수 있다.
- 의존성은 서비스가 시작하거나 자동으로 중단될때 결정된다.
- enable 되는 서비스의 의존성이 만족되지 않을때 그 서비스는 오프라인 상태를 유지하며
서비스 의존성이 만족되면 서비스는 구동된다. 만약 구동이 성공적이라면 그 서비스는 온라인
상태로 바뀐다.
- 서비스는 아래와 같이 표현되어진다.
svc://localhost/system/system-log:default
svc:/system/system-log:default
system/system-log:default
svc : SMF mnaged services
*. lrc: Legacy RC script
default : 인스턴스 이름
system/system-log : 서비스 이름.
init.d 스크립트는 svc 대신에 Irc 라는 이름으로 표기된다.
서비스 상태
offline - 구성정보는 로드 되었으나 아직 구동되지는 않은 상태.
online - 서비스가 활성화되어 있으며 성공적으로 구동된 상태
disabled - 서비스가 관리자에 의해 비활성화된 상태
legacy run - 레거시 서비스를 사용하고 있는 상태.
* smf 관리
- 서비스 시작/종료
- 서비스 의존성 확인 및 수정
- 서비스 상태 확인
- 서비스 시작 구성데이터에 대한 확인 및 수정
서비스 관리 명령어
svcs : 서비스 상태와 의존성 관계를 출력
svcadm : 서비스 시작 / 종료 명령어
svccfg : 서비스 설정 상태 출력 및 수정
svcprop : 서비스 등록정보 출력
inetadm : inetd의 구성과 inetd 에 관련된 서비스 상태 확인 및 제어
svcs 주요 옵션
-a list all service instances rather than only those that are enabled
-d list dependencies of the specified service(s)
-D list dependents of the specified service(s)
-H omit header line from output
-l list detailed information about the specified service(s)
-o list only the specified columns in the output
-p list process IDs and names associated with each service
-R list only those services with the specified restarter
-s sort output in ascending order by the specified column(s)
-S sort output in descending order by the specified column(s)
-v list verbose information appropriate to the type of output
-x explain the status of services that might require maintenance,
or explain the status of the specified service(s)
Services can be specified using an FMRI, abbreviation, or fnmatch(5)
pattern, as shown in these examples for svc:/network/smtp:sendmail
svcs [opts] svc:/network/smtp:sendmail
svcs [opts] network/smtp:sendmail
svcs [opts] network/*mail
svcs [opts] network/smtp
svcs [opts] smtp:sendmail
svcs [opts] smtp
svcs [opts] sendmail
ex)
# svcs ; 현재 disabled 된 서비스를 제외하고 모든 서비스 출력
# svcs -a ; disabled 된 서비스를 포함한 모든 서비스 상태 출력
* svcs -l svc:/network/smtp:sendmail ; 서비스 목록중 센드메일 서비스 상태만 출력(의존성 관계 포함)
river[/var/svc/log]# svcs -l svc:/network/smtp:sendmail
fmri svc:/network/smtp:sendmail
name sendmail SMTP mail transfer agent
enabled true
state online
next_state none
state_time 2008년 8월 19일 화요일 오후 01시 46분 55초
logfile /var/svc/log/network-smtp:sendmail.log
restarter svc:/system/svc/restarter:default
contract_id 55
dependency require_all/refresh file://localhost/etc/mail/sendmail.cf (online)
dependency require_all/refresh file://localhost/etc/nsswitch.conf (online)
dependency optional_all/none svc:/system/filesystem/autofs (online)
dependency require_all/none svc:/system/filesystem/local (online)
dependency require_all/none svc:/network/service (online)
dependency require_all/refresh svc:/milestone/name-services (online)
dependency optional_all/refresh svc:/system/identity:domain (online)
dependency optional_all/none svc:/system/system-log (online)
river[/var/svc/log]#
inetd 에 의해서 관리되는 서비스의 상태목록은 inetadm 명령어로 확인해야 한다.
inetadm 주요옵션
river[/var/svc/log]# inetadm -?
Usage:
inetadm
inetadm -?
inetadm -p
inetadm -l {FMRI | pattern}...
inetadm -e {FMRI | pattern}...
inetadm -d {FMRI | pattern}...
inetadm -m {FMRI | pattern}... {name=value}...
inetadm -M {name=value}...
Without any options inetadm lists all inetd managed services.
Options:
-? Print help.
-p List all default inetd property values.
-l List all inetd property values for the inet service(s).
-e Enable the inet service(s).
-d Disable the inet service(s).
-m Modify the inet service(s) inetd property values.
-M Modify default inetd property values.
ex)
river[/var/svc/log]# inetadm -l telnet
SCOPE NAME=VALUE
name="telnet"
endpoint_type="stream"
proto="tcp6"
isrpc=FALSE
wait=FALSE
exec="/usr/sbin/in.telnetd"
user="root"
default bind_addr=""
default bind_fail_max=-1
default bind_fail_interval=-1
default max_con_rate=-1
default max_copies=-1
default con_rate_offline=-1
default failrate_cnt=40
default failrate_interval=60
default inherit_env=TRUE
tcp_trace=TRUE
default tcp_wrappers=FALSE
default connection_backlog=10
설정값을 수정하려면 아래와 같이 -m 옵션을 사용하면 된다.
inetadm -m network/telnet:default tcp_trace=FALSE
'▒ 과거 기억 저장소 ▒ > Solaris10 UNIX' 카테고리의 다른 글
(9-1) solaris10 UNIX - apache2 구성방법 / virtualhost 구성방법 (0) | 2016.11.25 |
---|---|
(9) solaris10 UNIX - DNS 구성하는 방법(실습예제) 정방향 / 역방향 / named.conf (0) | 2016.11.25 |
(8-1) solaris10 UNIX - 풀백업, 증분백업 한것들 복구방법.(실습예제) ufsrestore (0) | 2016.11.25 |
(8) solaris10 UNIX - 풀백업, 증분백업(실습예제) backup / ufsdump / ufsrestore (0) | 2016.11.25 |
(7) solaris10 UNIX - cron (0) | 2016.11.09 |
댓글