Linux 版 (精华区)

发信人: clx (楚留香), 信区: Unix
标  题: SMB HOWTO(05)
发信站: 紫 丁 香 (Sat Jun 27 17:23:47 1998), 转信

SMB HOWTO : 执行这两个 daemon
Previous: 安装
Next: 一般组态设定 (/etc/smb.conf) 


4. 执行这两个 daemon

这两个 daemon 是 /usr/sbin/smbd 和 /usr/sbin/nmbd. 

你可以执行 Samba daemon 从 inetd 或当成单独的程序. 如果你正
设定一个永久档案伺服器,你应该从 inetd 来执行,所以如果他们死
掉,那将重新开始.如果你只是偶尔想要使用 SMB 伺服器,或者用系
统管理来辅助,当你需要时,你可以藉由使用 /etc/rc.d/init.d
script,或甚至直接手动的. 

要从 inetd 来执行 daemon , 请放以下几行在 inetd 组态档,
/etc/inetd.conf:



         # SAMBA NetBIOS services (for PC file and print sharing)
         netbios-ssn stream tcp nowait root /usr/sbin/smbd smbd
         netbios-ns dgram udp wait root /usr/sbin/nmbd nmbd



然後下指令以便重新启动 inetd daemon :



    kill -HUP 1



要从系统启动的 script 来执行 daemon, 请把以下的 script 置於
一个叫做 /etc/rc.d/init.d/smb 档, 而且 symbolically link 到
注释{comments}所说明的档案:



         #!/bin/sh

         #
         # /etc/rc.d/init.d/smb - starts and stops SMB services.
         #
         # The following files should be synbolic links to this file:
         # symlinks: /etc/rc.d/rc1.d/K35smb  (Kills SMB services on shutdown)
         #           /etc/rc.d/rc3.d/S91smb  (Starts SMB services in multiuser mode)
         #           /etc/rc.d/rc6.d/K35smb  (Kills SMB services on reboot)
         #

         # Source function library.
         . /etc/rc.d/init.d/functions

         # Source networking configuration.
         . /etc/sysconfig/network

         # Check that networking is up.
         [ ${NETWORKING} = "no" ] && exit 0

         # See how we were called.
         case "$1" in
           start)
             echo -n "Starting SMB services: "
             daemon smbd -D  
             daemon nmbd -D 
             echo
             touch /var/lock/subsys/smb
             ;;
           stop)
             echo -n "Shutting down SMB services: "
             killproc smbd
             killproc nmbd
             rm -f /var/lock/subsys/smb
             echo ""
             ;;
           *)
             echo "Usage: smb {start|stop}"
             exit 1
         esac




SMB HOWTO : 执行这两个 daemon
Previous: 安装
Next: 一般组态设定 (/etc/smb.conf) 

--
※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: 202.118.244.16]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.993毫秒