ÀÌÀüÆäÀÌÁö ´ÙÀ½ÆäÀÌÁö Â÷·Ê

4. µ¥¸ó ½ÇÇà½ÃÅ°±â

»ï¹ÙÀÇ µÎ µ¥¸óÀº /usr/sbin/smbd ¿Í /usr/sbin/nmbd ÀÌ´Ù. »ï¹Ù µ¥¸óÀº inetd ¿¡ ÀÇÇؼ­³ª µ¶¸³µÈ °úÁ¤À¸·Î ½ÇÇàµÇ¾îÁú ¼ö ÀÖ´Ù. ¿µ±¸ÀûÀÎ È­ÀÏ ¼­¹ö·Î ¼³Ä¡¸¦ ÇÑ´Ù¸é, »ï¹Ù µ¥¸óÀÌ Áß´ÜµÇ¸é ´Ù½Ã ½ÇÇàµÉ ¼ö ÀÖµµ·Ï inetd ¿¡ ÀÇÇؼ­ ½ÇÇàµÉ °ÍÀÌ´Ù. »ï¹Ù ¼­ºñ½º¸¦ °¡²û¾¿ »ç¿ëÇϰųª ´ÜÁö ½Ã½ºÅÛ °ü¸®¿¡ ÀÌ¿ëÇϱâ À§Çؼ­¶ó¸é /etc/rc.d/init.d ½ºÅ©¸³Æ®¿¡¼­ ½ÇÇà½ÃÅ°°Å³ª Á÷Á¢ ÇÊ¿ä¿¡ µû¶ó ¼öÀÛ¾÷À¸·Î ½ÇÇà½Ãų ¼ö ÀÖ´Ù.

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 µ¥¸óÀ» ´ÙÀ½°ú °°ÀÌ Àç½ÇÇà ½ÃŲ´Ù.


    kill -HUP 1

½Ã½ºÅÛ Ãʱ⠽ÇÇà ½ºÅ©¸³Æ®¿¡¼­ µ¥¸óÀ» ½ÇÇà½ÃÅ°±â À§Çؼ­´Â ¾Æ·¡ÀÇ ½ºÅ©¸³Æ®¸¦ /etc/rc/d/init.d/smb ·Î ÀúÀåÀ» ÇÏ°í ÁÖ¼®¿¡ ³ª¿ÍÀִµ¥·Î ½Éº¼¸¯ ¸µÅ©¸¦ ÇؾßÇÑ´Ù.


    #!/bin/sh

    #
    # /etc/rc.d/init.d/smb - »ï¹Ù ¼­ºñ½º¸¦ ½ÃÀÛ, ÁßÁöÇÑ´Ù.
    #
    # ¾Æ·¡¿Í °°ÀÌ ÀÌ È­ÀÏÀ» ½Éº¼¸¯ ¸µÅ©¸¦ ½ÃŲ´Ù.
    # 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)
    #

    # ÇÔ¼ö ¶óÀ̺귯¸® ¼Ò½º
    . /etc/rc.d/init.d/functions

    # ³×Æ®¿öÅ© ¼³Á¤ ¼Ò½º
    . /etc/sysconfig/network

    # ³×Æ®¿öÅ© °¡´É»óŸ¦ Á¡°ËÇÑ´Ù
    [ ${NETWORKING} = "no" ] && exit 0

    # ¼­ºñ½º¸¦ ½ÃÀÛ ¶Ç´Â ÁßÁö½ÃŲ´Ù.
    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


ÀÌÀüÆäÀÌÁö ´ÙÀ½ÆäÀÌÁö Â÷·Ê