中華技術學院 linux 課程 中華技術學院 linux 課程 chap one : service control...

12
中中中中中中 中中中中中中 Linux Linux 中中 中中 Chap one : Service Contro Chap one : Service Contro l l 中中中 中中中 RHCE/RHCX RHCE/RHCX

Upload: dennis-sims

Post on 17-Jan-2018

269 views

Category:

Documents


0 download

DESCRIPTION

Service Management  init  System V scripts  direct command  xinetd

TRANSCRIPT

Page 1: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

中華技術學院中華技術學院LinuxLinux 課程課程

Chap one : Service ControlChap one : Service Control王俊城王俊城RHCE/RHCXRHCE/RHCX

Page 2: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

AgendaAgenda Service managementService management System V-managed servicesSystem V-managed services xinetdxinetd

Page 3: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

Service ManagementService Management init init System V scriptsSystem V scripts direct command direct command xinetdxinetd

Page 4: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

Services Managed by initServices Managed by init Typically non-TCP/IP servicesTypically non-TCP/IP services

Respawn capabilityRespawn capabilityConfigured in /etc/inittabConfigured in /etc/inittabinit qinit q

Page 5: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

System V Service ManagementSystem V Service Management /etc/rc.d/init.d/gpm start/etc/rc.d/init.d/gpm start /etc/init.d/gpm start/etc/init.d/gpm start service gpm startservice gpm start

Page 6: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

chkconfigchkconfig chkconfig gpm --listchkconfig gpm --list

/etc/rc.d/rc?.d/*gpm/etc/rc.d/rc?.d/*gpm chkconfig gpm onchkconfig gpm on chkconfig gpm offchkconfig gpm off chkconfig gpm --delchkconfig gpm --del chkconfig gpm --addchkconfig gpm --add chkconfig telnet onchkconfig telnet on

/etc/xinetd.d/telnet/etc/xinetd.d/telnet

Page 7: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

Xinetd Managed ServicesXinetd Managed Services xinetd xinetd standalone itself standalone itself

less-frequently needed servicesless-frequently needed serviceshost-based authenticationhost-based authenticationservice statistics and loggingservice statistics and loggingservice IP redirectionservice IP redirection

Replaces inetdReplaces inetd Linked with libwrap.soLinked with libwrap.so Configuration files:/etc/xinetd.conf,/etc/Configuration files:/etc/xinetd.conf,/etc/xinetd.d/*xinetd.d/*

Page 8: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

xinetd default controlsxinetd default controls /etc/xinetd.conf/etc/xinetd.conf

defaultsdefaults{{ instances = 60instances = 60 log_type = SYSLOG authprivlog_type = SYSLOG authpriv log_on_success = HOST PIDlog_on_success = HOST PID log_on_failure = HOSTlog_on_failure = HOST cps = 25 30cps = 25 30}}includedir /etc/xinetd.dincludedir /etc/xinetd.d

Page 9: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

xinetd service controlsxinetd service controls /etc/xinetd.d/*/etc/xinetd.d/*

service telnetservice telnet{{ flags = REUSEflags = REUSE socket_type = streamsocket_type = stream wait = nowait = no user = rootuser = root server = /usr/sbin/in.telnetdserver = /usr/sbin/in.telnetd log_on_failure += USERIDlog_on_failure += USERID disable = yesdisable = yes}}

Page 10: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

LAB1-standalone serviceLAB1-standalone service runlevelrunlevel init 3init 3 chkconfig gpm onchkconfig gpm on service gpm stop (X)service gpm stop (X) init 5 (V)init 5 (V) chkconfig gpm off (V)chkconfig gpm off (V) init 3 (X)init 3 (X) service gpm start (V)service gpm start (V) chkconfig gpm onchkconfig gpm on

Page 11: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

LAB2-xinetdLAB2-xinetd runlevelrunlevel init 3init 3 chkconfig telnet offchkconfig telnet off telnet localhost (X)telnet localhost (X) chkconfig telnet on (V)chkconfig telnet on (V) telnet localhost (V)telnet localhost (V) chkconfig telnet --listchkconfig telnet --list

Page 12: 中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX

T h an k Y ou !