中華技術學院 Linux 課程 中華技術學院 Linux 課程 Chap one : Service Control 王俊城RHCE/RHCX
Agenda Service management System V-managed services xinetd
Service Management init System V scripts direct command xinetd
Services Managed by init Typically non-TCP/IP services Respawn capability Configured in /etc/inittab init q
System V Service Management /etc/rc.d/init.d/gpm start /etc/init.d/gpm start service gpm start
chkconfig chkconfig gpm --list /etc/rc.d/rc?.d/*gpm chkconfig gpm on chkconfig gpm off chkconfig gpm --del chkconfig gpm --add chkconfig telnet on /etc/xinetd.d/telnet
Xinetd Managed Services xinetd standalone itself less-frequently needed services host-based authentication service statistics and logging service IP redirection Replaces inetd Linked with libwrap.so Configuration files:/etc/xinetd.conf,/etc/xinetd.d/*
xinetd default controls /etc/xinetd.conf defaults{ instances = 60 instances = 60 log_type = SYSLOG authpriv log_type = SYSLOG authpriv log_on_success = HOST PID log_on_success = HOST PID log_on_failure = HOST log_on_failure = HOST cps = cps = 25 30} includedir /etc/xinetd.d
xinetd service controls /etc/xinetd.d/* service telnet { flags = REUSE flags = REUSE socket_type = stream socket_type = stream wait = no wait = no user = root user = root server = /usr/sbin/in.telnetd server = /usr/sbin/in.telnetd log_on_failure += USERID log_on_failure += USERID disable = yes disable = yes}
LAB1-standalone service runlevel init 3 chkconfig gpm on service gpm stop (X) init 5 (V) chkconfig gpm off (V) init 3 (X) service gpm start (V) chkconfig gpm on
LAB2-xinetd runlevel init 3 chkconfig telnet off telnet localhost (X) chkconfig telnet on (V) telnet localhost (V) chkconfig telnet --list