管理守護進程

管理守護進

 

 

[root@linux ~]#pstree [-Aup]                                   #看守護進

-A                                                             #各程序 ASCII 字符來連

-p                                                             #列出每 process PID

-u                                                             #列出每 process 的所屬賬號

 

行的守護進程的用和停止(stand_alone)

#直接 /etc/init.d/ 下的腳本管理守護進程:

[root@linux ~]#/etc/init.d/server-name  start|stop|restart|reload

#或者使用 service 命令:

[root@linux ~]#service server-name  start|stop|restart|reload

 

由超行的守護進程的用和停止(super daemon)

#修改 /etc/xinetd.d/ 下的相文件: 用服,使用 disable = no   選項

                                       停用服,使用 disable = yes 選項

#重新啓動器:

[root@linux ~]#/etc/init.d/xinetd restart

[root@linux ~]#service xinetd restar

 

使用 chkconfig 管理啓動腳本

[root@linux ~]#chkconfig --list [server-name]     #示由 chkconfig 管理的所有服

[root@linux ~]#chkconfig --add server-name        #添加由 chkconfig 行管理的指定服

[root@linux ~]#chkconfig --del server-name        #除由 chkconfig 行管理的指定服

[root@linux ~]#chkconfig [--level <levels>] server-name <on|off|reset|resetpriorities>

#on|off:在指定的級別開啓關閉。在指定的級別,重置,使其狀態返回到操作系

#啓動時的默認狀態

[root@linux ~]#chkconfig rsync on                 # 於配置文件中的  disable = no

[root@linux ~]#chkconfig rsync off                # 於配置文件中的  disable = yes

 

管理護進程的的狀態

[root@linux ~]#ntsysv

 

網絡器的典型配置方法

收集服件包信息:

rpm -qa | grep <護進程名或服件名>

rpm -qi        <護進程名或服件名>

rpm -ql        <護進程名或服件名>

rpm -qc        <護進程名或服件名>

rpm -qd        <護進程名或服件名>

的配置及啓動

#每次修改完配置文件均要重新啓動服務重新讀取配置文件:

·   獨立啓動: service <守護進程名> reload|restart

·   xinetd 啓動:service xinetd reload|restart

#爲了修改服務守護進程在下次啓動時的啓動狀態,還可以使用 chkconfig ntsysv

#爲了加強服務的安全控制,通常還要配置:

·   xinetd 啓動的守護進程,可以通過修改相應的 xinetd 配置文件配置訪問控制規則

·   支持 TCPWrapper 的守護進程,可以修改 /etc/hosts.allow /etc/hosts.deny 配置基於主機的訪問控制

·   在配置了包過濾防火牆的服務器上,還要相應地修改防火牆規則以便外界可以訪問本服務

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章