Subject : SAF(Service Access Facility)
Description :
1.¼Ò°³
ÀÌ °úÁ¤Àº terminal À̳ª modem °°Àº serial device ¸¦ Á¦¾îÇϱâÀ§ÇÏ¿© »ç¿ëµÇ´Â
command µéÀ»À§ÇÑ SAF(service access facility) ÀÇ Æ¯Â¡À» ¼³¸íÇÏ¸ç ¶ÇÇÑ
SAF ´Â remote print requests ¿Í°°Àº network services À» Áö¿øÇÑ´Ù.
Solaris 2.x ȯ°æÀº terminal °ú network device ¸¦ À§ÇÑ STREAM-based character
I/O À» »ç¿ëÇϸç standard terminal I/O processing À» À§ÇØ ldterm À̶ó°íÇÏ´Â
STREAM module À» »ç¿ëÇϰí ÀÌ ldterm Àº line discipline module ¶ó°í ¾Ë·ÁÁ®ÀÖ´Ù.
2.SAF Overview
SAF ´Â terminal °ú modem access , ±×¸®°í remote print requests ¿Í °°Àº
network service access ¸¦ control ÇÑ´Ù.
SAF´Â local °ú network resources ¸¦ ºñ½ÁÇÑ ¹æ¹ýÀ¸·Î control ÇÑ´Ù.
System °ü¸®ÀÚ´Â Çϳª¶Ç´Â ±×ÀÌ»óÀÇ portÀÇ service ¸¦ Á¦°øÇϱâÀ§ÇØ
SAF's port monitors ¸¦ ±¸¼ºÇؾßÇÑ´Ù.
3.SAF ±¸Á¶
3-1. init process ´Â sac ¸¦ invoke, sac ´Â saf ÀÇ master processÀÓ.
3-2. sac °üÇö command ´Â port monitor ¸¦ control Çϴµ¥ »ç¿ëµÊ.
3-3. ÇϳªÀÇ port monitor ´Â serial port device ¶Ç´Â network port ¸¦
control Çϴµ¥ »ç¿ëµÊ.
4. SAC ÀÇ ÃʱâÈ °úÁ¤
sac ´Â ¸ðµç port monitors ÀÇ overseer À̸ç À̰ÍÀº ½Ã½ºÅÛÀÌ /etc/inittab
file ÀÇ ÇϳªÀÇ entry ·Î¼ run level 2 ·Î ¿î¿ëµÉ¶§ ±¸µ¿µÈ´Ù. ½Ã½ºÅÛ
ÄܼÖÀ» À§ÇØ ttymon port monitor °¡ ÀÖ´Ù.
sac ÀÌ invoke µÉ¾úÀ»¶§, system configuration script(/etc/saf/_sysconfig)
ÈÀÏÀ» Àдµ¥ À̰ÍÀº environment ¸¦ È®ÀÎÇϱâÀ§ÇؼÀ̰í À̰ÍÀ» ´ÙÀÐÀºÈÄ¿¡´Â
administrative file(/etc/saf/_sactab)file À» ÀÐ¾î ¸í½ÃµÈ port monitor ¸¦
±¸µ¿ÇÑ´Ù.
sac Àº _sactab file ¿¡ Á¤ÀÇµÈ °¢ port monitor ¸¦ À§ÇÑ »õ·Î¿î child process
¸¦ »ý¼ºÇÏ¸ç °¢ port monitor ´Â port monitor directory(zsmon,tcp) ¹ØÀÇ
_pmtab file(administrative) ¸¦ ÀÐ¾î¼ °¢ ports ¿¡ ±¸µ¿ÇÒ service ¸¦ È®ÀÎÇÑ´Ù.
5. Port Monitor Types
µÎ°³ÀÇ port monitor type ÀÌ SAF ÇÏ¿¡¼ Á¸ÀçÇϴµ¥ ¹Ù·Î ttymon °ú listen ÀÌ´Ù.
5-1. ttymon Monitor
ttymon monitor ´Â STREAMS-based TTY port monitor ·Î¼ ports , terminal modes,
baud rates, login process ¸¦ invoke ÇÏ¸ç ¶ÇÇÑ ´Ù¸¥ Ưº°ÇÑ service °í invoke.
sac ÇÏ¿¡¼ ±¸µ¿µÇ´Â ttymon monitor ÀÇ instance ´Â sacadm command ·Î½á ±¸¼ºµÉ¼ö
ÀÖÀ¸¸ç multiple ports µµ °¡´ÉÇÏ´Ù. Çѹø ÇϳªÀÇ port monitor ÀÇ ÇÑ instance °¡
»ý¼ºµÇ¸é, ttymon °ü·Ã information ÀÎ Á¦°øµÉ service, Ãß°¡µÉ ±â´ÉÀ» pmadm °ú
ttyadm command ·Î½á »ç¿ë°¡´ÉÇÏ´Ù.
5-2. listen Monitor
sac ÇÏ¿¡¼ µ¹¾Æ°¡´Â network listener daemon À¸·Î remote print requests ¿Í ±×·¯ÇÑ
¼ºñ½º¸¦ Á¦°øÇϱâÀ§ÇØ ÇØ´ç servers ¸¦ ±¸µ¿ÇÏ´Â ÀÏ·ÃÀÇ °úÁ¤°ú °°Àº service
request À» À§ÇÑ network endpoint »ó¿¡¼ listen ÇÑ´Ù.
°¢ listen ÀÇ instance ´Â sacadm command ·Î½á ±¸¼ºµÇ¸é listen-specific
info (server providing the service) ´Â pmadm °ú nlsadmin command ·Î½á ±¸¼ºµÊ.
6. TTY Port Monitor
6-1.Terminal ÃʱâÈ °úÁ¤
Çѹø sac ¿¡ ÀÇÇØ ttymon monitor instance °¡ invoke µÇ¸é, ´ÙÀ½°ú °°Àº °úÁ¤À¸·Î
ÇØ´ç port ÀÇ monitoring À» ½ÃÀÛÇÑ´Ù.
1) ttymon Àº speed , terminal setting ¸¦ ÇØ´çÆ÷Æ®¿¡ ¿ì¼± Ãʱâȸ¦ ÇÑ´Ù.
À̶§ ÂüÁ¶ÇÏ´Â ÈÀÏÀº /etc/ttydefs ÀÌ´Ù.
2) user input À» À§ÇØ prompt ¸¦ ³»°í wait ÇÑ´Ù.¸¸¾à user °¡ Break key ¸¦ »ç¿ë
ÇÏ¿© speed °¡ ÀûÀýÇÏÁö ¾ÊÀ¸¸é ttymon Àº ´ÙÀ½ÀÇ speed ¸¦ ã¾Æ¼ prompt ¸¦ ³½´Ù.
3)ÀûÀýÇÑ input ÀÌ µé¾î¿À¸é,ttymon Àº ÇÊ¿äÇϸé /var/adm/utmp entry ¸¦ ¸¸µé°í
service environment ¸¦ È®¸³ÇÏ°í ±× port ¿¡ ÀûÀýÇÑ service ¸¦ invoke ÇÑ´Ù.
4)service °¡ ³¡³ÈÄ, ttymon Àº /var/adm/utmp entry ¸¦ clean ÇÏ°í ¸¸¾à entry
°¡ Á¸ÀçÇÏ¸é ±× port ¸¦ Ãʱâ»óÅ·Πµ¹¸°´Ù.
6-2 using Autobaud
ttymon monitor ´Â ÇØ´ç port ¿¡ autobaud °¡ enable µÇ¸é ÀÚµ¿ÀûÀ¸·Î ±× port ¿¡
baud rate ¸¦ °áÁ¤ÇϰԵȴÙ. user ´Â ¹Ýµå½Ã ttymon monitor °¡ baud rate ¿Í
prompt ¸¦ ÀνÄÇϱâÀü¿¡ Return ¸¦ ´·¯¾ßµÈ´Ù. ÇöÀç, baud rate ´Â autobaud
110,1200,2400,4800,9600 ¿¡ÀÇÇØ °áÁ¤µÇ¾îÁú¼ö°¡ ÀÖ´Ù.
6-3. Bidirectional Service
¸¸¾à, ÇϳªÀÇ port °¡ bidirectional service ·Î ±¸¼ºµÇ¾îÀÖ´Ù¸é, ttymon monitor ´Â user °¡ ÇϳªÀÇ service ¿¡ ¿¬°áÇÒ¼öÀÖµµ·Ï °¡´ÉÇÏ°Ô ÇÑ´Ù. ±×¸®°í port °¡
free À̸é tip °ú °°Àº communication commands °¡ dialing out ¸¦ ÇÒ¼öÀÖµµ·ÏÇÔ.
7.sacadm command
/usr/sbin/sacadm command ´Â ttymon °ú listen °°Àº port monitor ¸¦ ´õÇϰųª
¾ø¾Ö´Âµ¥ »ç¿ëµÈ´Ù. Çѹø, port monitor ÀÇ instance °¡ Ãß°¡µÇ°í ±×°ÍÀÇ
service °¡ Á¤ÀǵǸé, ½Ã½ºÅÛÀÌ reboot ÈÄ¿¡ ´ÙÀ½°ú °°Àº action ÀÌ ÀϾÙ.
* sac process Àº /etc/saf/_sactab file À» ÀÐ¾î ±¸µ¿µÉ port monitor ¸¦ ¾Ë¾Æ³¿.
* °¢°¢ÀÇ port monitor(ex:zsmon,tcp) ÀÇ instance °¡ °¡Áö°í ÀÖ´Â(sub-dir)ÀÇ
/etc/saf/zsmon/_pmtab or /etc/saf/tcp/_pmtab file À» ÀÐ¾î¼ ±¸µ¿µÉ service ¸¦
È®ÀÎÇÑ´Ù.
´Ù¸¥ sacadm ±â´ÉÀº port monitor ÀÇ °¢°¢ ÇöÀçÀÇ »óŸ¦ listing ÇÏ°í ±×µéÀÇ
operational states ¸¦ ¹Ù²Ü¼ö ÀÖ´Ù.
*Operational States
sacadm command ´Â port monitors ÀÇ °¢ state ¸¦ control ÇÒ¼ö°¡ÀÖ´Ù.
1)Port monitors ´Â ±×µéÀÌ Ãß°¡µÉ¶§¿¡ default ·Î ±¸µ¿µÇ°í enable µÈ´Ù.
2)Port monitors ´Â ±×µéÀÌ deleteµÉ¶§ default ·Î stop, disable µÈ´Ù.
3)Port monitors ´Â ±×µéÀÌ enableµÉ¶§ service¸¦ À§ÇÏ¿© request ¸¦ accept.
4)Port monitors ´Â ±×µéÀÌ disableµÉ¶§ existing services¸¦ °è¼ÓÇϸç
»õ·Î¿î service °¡ Ãß°¡µÉ¶§ °ÅÀýÇÒ¼ö°¡ ÀÖ´Ù.
5)¸ðµç port monitor services ´Â rmemfdl Á×À»¶§¿¡ Á¾·áµÈ.
7-1. Adding ttymon Port Monitors
sacadm command ´Â Ãʱ⿡ ttymon port monitor ¸¦ Ãß°¡ÇϱâÀ§ÇØ »ç¿ëµÈ´Ù.
Command format:
sacadm -a -p pmtag -t type -c command -v version
options:
-a : add option
-p : pmtag(name variable , ¿©±â¼´Â zsmon)
-t : port monitor type (ttymon or listen)
-c : port monitor ¸¦ ±¸µ¿ÇÒ command string.
-v : port monitor version number (/usr/sbin/ttyadm -V)
Ex:
hyundai3# sacadm -l
PMTAG PMTYPE FLGS RCNT STATUS COMMAND
tcp listen - 999 ENABLED /usr/lib/saf/listen tcp #
zsmon ttymon - 0 ENABLED /usr/lib/saf/ttymon #
hyundai3# sacadm -a -p zsmon1 -t ttymon -c /usr/lib/saf/ttymon -v 1
hyundai3# sacadm -l
PMTAG PMTYPE FLGS RCNT STATUS COMMAND
tcp listen - 999 ENABLED /usr/lib/saf/listen tcp #
zsmon ttymon - 0 ENABLED /usr/lib/saf/ttymon #
zsmon1 ttymon - 0 STARTING /usr/lib/saf/ttymon #
hyundai3#
7-2. Listing TTY Monitors
-l option Àº ¸ðµç port monitors ÀÇ ÇöÀç»óŸ¦ check.
7-3. Killing a TTY Monitors
hyundai3# sacadm -k -p zsmon0
Invalid request, zsmon0 does not exist
hyundai3# sacadm -k -p zsmon1
hyundai3# sacadm -l -p zsmon1
PMTAG PMTYPE FLGS RCNT STATUS COMMAND
zsmon1 ttymon - 0 NOTRUNNING /usr/lib/saf/ttymon #
7-4. Starting a TTY Monitors
hyundai3# sacadm -s -p zsmon1
hyundai3# sacadm -l -p zsmon1
PMTAG PMTYPE FLGS RCNT STATUS COMMAND
zsmon1 ttymon - 0 STARTING /usr/lib/saf/ttymon #
7-5. Disabling a TTY Monitors
hyundai3# sacadm -d -p zsmon1
hyundai3# sacadm -l -p zsmon1
PMTAG PMTYPE FLGS RCNT STATUS COMMAND
zsmon1 ttymon - 0 DISABLED /usr/lib/saf/ttymon #
7-6. Enabling a TTY Monitors
hyundai3# sacadm -e -p zsmon1
hyundai3# sacadm -l -p zsmon1
PMTAG PMTYPE FLGS RCNT STATUS COMMAND
zsmon1 ttymon - 0 ENABLED /usr/lib/saf/ttymon #
hyundai3#
7-7. Removing a TTY Monitors
hyundai3# sacadm -r -p zsmon1
hyundai3# sacadm -l -p zsmon1
Invalid request, zsmon1 does not exist
8.pmadm command
/usr/sbin/pmadm command ´Â add or remove service ¿Í service ¸¦ enable, disable
¿¡ »ç¿ëµÇ´Â service administration command ÀÌ´Ù.ÇϳªÀÇ service ÀÇ °¢ instance ´Â
±×°ÍÀÇ service tag ¿¡ ÀÇÇØ ¸í½ÃµÇ¸ç º¸Åë port monitor type °ú ±× service ¸¦
»ç¿ëÇϴ ƯÁ¤ port ·Î ±¸¼ºµÈ´Ù.¿¹¸¦ µé¸é,
tty ¶ó´Â service tag ´Â serial B ¸¦ À§ÇÑ service ¸¦ ³ªÅ¸³¿.
* Service states : Services ´Â port monitor ¸¸Å ¸¹Àº states ¸¦ °¡ÁúÇʿ䰡 ¾ø´Ù.Áï, ÇϳªÀÇ ¼ºñ½º´Â ½ÇÁ¦ÀûÀ¸·Î ÇϳªÀÇ process À̸ç Á¸ÀçÇϰųª ¾Æ´Ï¸é Á¸ÀçÇÏÁö
¾Ê´Â´Ù. service ¸¦ °ü¸®ÇÒ¶§ ´ÙÀ½À» ±â¾ïÇ϶ó.
1) ÇϳªÀÇ service ÀÇ invocation Àº default ·Î ±×°ÍÀÌ Ãß°¡µÉ¶§¿¡ enable µÈ´Ù.
2) ÇϳªÀÇ service ´Â ±×°ÍÀÌ enable µÉ¶§¿¡ operate µÈ´Ù.
3) ÇϳªÀÇ service ´Â ±×°ÍÀÌ disable µÉ¶§¿¡ stop µÈ´Ù.
8-1.Adding Services to a TTY Monitor
ÇϳªÀÇ port monitor ¿¡ service ¸¦ add Çϴµ¥ »ç¿ëÇÏ´Â command.
Example:
hyundai3#pmadm -a -p zsmon1 -s ttya -i root -fu -v 1 -m "`ttyadm -l 9600 -d /dev/term/a -T tvi925 -i 'terminal disabled' -s /usr/bin/login -S y`"
hyundai3# pmadm -l
PMTAG PMTYPE SVCTAG FLGS ID
zsmon1 ttymon ttya u root /dev/term/a - - /usr/bin/login - 9600 - login: terminal disabled tvi925 y #
tcp listen lp - root - - p - /var/spool/lp/fifos/listenS5 #
tcp listen lpd - root \x00020203000000000000000000000000 - p - /var/spool/lp/fifos/listenBSD #
tcp listen 0 - root \x00020ACE000000000000000000000000 - c - /usr/lib/saf/nlps_server #
zsmon ttymon ttyb u root /dev/term/b I - /usr/bin/login - 9600 ldterm,ttcompat ttyb login: - tvi925 y #
zsmon ttymon ttya u root /dev/term/a I - /usr/bin/login - 9600 ldterm,ttcompat login: - tvi925 y #
Options:
-a : add
-p : port monitor ¿¡ °ü·ÃµÈ pmtag
-s : service tag
-i : service ¿¡ ÇÒ´çµÉ identity.
-f : utmp ¸¦ »ý¼ºÇÒ tag ÀÎ u, »ý¼ºÇÏÁö¾ÊÀ» x.
-m : ttyadm °ü·Ã command.
-r : ÇϳªÀÇ port ¸¦ À§ÇÑ service ¸¦ remove.
Service Tags: service tag ¿Í port monitor tag ÀÇ Á¶ÇÕÀº uniquely ÇϳªÀÇ
service instance ¸¦ ³ªÅ¸³¿. À̰ÍÀº pmadm command ´Â service (-s option) °ú
port monitor instance (-p options) Àº °¡´ÉÇÑ service ¸¦ ³ªÅ¸³»±â¶§¹®ÀÓ.
8-1.Listing One service
hyundai3# pmadm -l -s ttya
PMTAG PMTYPE SVCTAG FLGS ID
zsmon1 ttymon ttya u root /dev/term/a - - /usr/bin/login - 9600 - login: terminal disabled tvi925 y #
zsmon ttymon ttya u root /dev/term/a I - /usr/bin/login - 9600 ldterm,ttcompat login: - tvi925 y #
8-2.Listing All service
hyundai3# pmadm -l -p zsmon
PMTAG PMTYPE SVCTAG FLGS ID
zsmon ttymon ttyb u root /dev/term/b I - /usr/bin/login - 9600 ldterm,ttcompat ttyb login: - tvi925 y #
zsmon ttymon ttya u root /dev/term/a I - /usr/bin/login - 9600 ldterm,ttcompat login: - tvi925 y #
8-3.Listing All port monitors
hyundai3# pmadm -l -p zsmon
PMTAG PMTYPE SVCTAG FLGS ID
zsmon ttymon ttyb u root /dev/term/b I - /usr/bin/login - 9600 ldterm,ttcompat ttyb login: - tvi925 y #
zsmon ttymon ttya u root /dev/term/a I - /usr/bin/login - 9600 ldterm,ttcompat login: - tvi925 y #
8-4.Disabling a Service
hyundai3# pmadm -d -p zsmon -s ttya
hyundai3# pmadm -l -p zsmon
PMTAG PMTYPE SVCTAG FLGS ID
zsmon ttymon ttyb u root /dev/term/b I - /usr/bin/login - 9600 ldterm,ttcompat ttyb login: - tvi925 y #
zsmon ttymon ttya ux root /dev/term/a I - /usr/bin/login - 9600 ldterm,ttcompat login: - tvi925 y #
8-5.Enabling a Service
hyundai3# pmadm -e -p zsmon -s ttya
hyundai3# pmadm -l -p zsmon
PMTAG PMTYPE SVCTAG FLGS ID
zsmon ttymon ttyb u root /dev/term/b I - /usr/bin/login - 9600 ldterm,ttcompat ttyb login: - tvi925 y #
zsmon ttymon ttya u root /dev/term/a I - /usr/bin/login - 9600 ldterm,ttcompat login: - tvi925 y #
hyundai3#
9. TTY Monitor-Specific Command (ttyadm, nlsadmin)
µÎ°³ÀÇ port monitor types ÀÌ ÀÖ´Ù.
*ttyadm : TTY monitors ¸¦ ±¸¼ºÇϱâÀ§ÇÏ¿© »ç¿ëµÊ
*nlsadmin : network listeners ¸¦ ±¸¼ºÇϴµ¥ »ç¿ëµÊ.
Example:
hyundai3#pmadm -a -p zsmon1 -s ttyc -i root -fu -v 1 -m "`ttyadm -l 9600 -d /dev/term/a -T tvi925 -i 'terminal disabled' -s /usr/bin/login -S y`"
ttyadm Options:
-l : /etc/ttydefs file ÀÇ baud rate)
-d : ±× device ÀÇ full path name
-T : Terminal type name
-i : service °¡ disable µÉ¶§ Ç¥½ÃµÉ messages.
-s : service program ÀÇ full path name
-S y : software carrier detect ¸¦ turn on.
10. SAF file log information
10-1)/var/saf/_log : sac's log file
hyundai3# pwd
/var/saf
hyundai3# ls -F
_log tcp/ zsmon/ zsmon1/
hyundai3#
hyundai3# more _log
.....
Thu Aug 8 12:26:05 1996; 298; *** SAC starting ***
Thu Aug 8 12:26:05 1996; 298; can not open _pid file for
Thu Aug 8 12:26:05 1996; 298; can not open _pid file for
Thu Aug 8 12:26:06 1996; 301; starting port monitor
Thu Aug 8 12:26:06 1996; 298; port monitor changed state from STARTING to ENABLED
Thu Aug 8 12:35:00 1996; 365; *** SAC starting ***
Thu Aug 8 12:35:00 1996; 367; starting port monitor
Thu Aug 8 12:35:00 1996; 365; port monitor changed state from STARTING to ENABLED
.....
10-1)/var/saf/pmtag/_log : pmtag log file
hyundai3# cd /var/saf
hyundai3# ls
_log tcp zsmon zsmon1
hyundai3# cd zsmon
hyundai3# ls -al
ÃÑ 70
drwxr-xr-x 2 root sys 512 8¿ù 8ÀÏ 11:55 .
drwxr-xr-x 5 bin bin 512 9¿ù 11ÀÏ 16:13 ..
-rw-r--r-- 1 root sys 33233 9¿ù 11ÀÏ 16:35 log
hyundai3# more log
Thu Aug 8 12:26:06 1996; 301;
Thu Aug 8 12:26:06 1996; 301; ********** ttymon starting **********
Thu Aug 8 12:26:06 1996; 301; PMTAG: zsmon
Thu Aug 8 12:26:06 1996; 301; Starting state: enabled
Thu Aug 8 12:26:06 1996; 301; Got SC_ENA
.....
11.Summary
11-1)SAF controls terminal and modem access and network service access,
such as remote print requests.
11-2)sac process is started by init from an entry in the /etc/inittab file.
11-3) listen and ttymon port monitors are started by entries in the
sac process' configuration file.
11-4) ttymon port monitor initializes the speed and terminal settings for
each port and then invokes the service when valid input is received.
11-5) sacadm command is used to add an instance of a port monitor
11-6) pmadm command is used to associate a port monitor instance with a service
11-7) ttyadm command is embedded in the pmadm command to format the
TTY-specific information.
Revision History
ÀÛ¼ºÀÏÀÚ : 96.09.05
ÀÛ¼ºÀÚ : À̽ÂÈÆ
¼öÁ¤ÀÏÀÚ :
¼öÁ¤ÀÚ :