질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

samba 구동 실패

작성자 정보

  • 임근식 작성
  • 작성일

컨텐츠 정보

본문

 

Samba는 페도라코어 5와 같이 특정 배포판에서 RPM설치시 네트웍 인즐 모듈의
문제로 서비스가 정상적으로 실행되지 않거나 윈도우 XP 에서
정상적으로  접근이 안되는 경우가 있다. 이런 경우 아래와 같이 소스 설치
방법을 통하여 해결이 가능합니다.

* 설치환경
 . 배포판: Fedora Core5
 . Kernel: 2.6.15-1.2054_FC5 
 . 필요 라이브러리 : 
    LIBS = -lcrypt -lcap -lresolv -lresolv -lnsl -ldl
    KRB5_LIBS =  -lgssapi_krb5 -lkrb5 -lk5crypto -lkrb5support -lcom_err -lresolv
    LDAP_LIBS = -lldap -llber
    AUTH_LIBS = -lcrypt

fc5#> rpm -qa | grep samba
samba-common-3.0.22-1.fc5
samba-3.0.22-1.fc5
samba-client-3.0.22-1.fc5
fc5#> rpm -e samba******
fc5#> cd /root
fc5#> wget http://us1.samba.org/samba/ftp/samba-3.0.23d.tar.gz
fc5#> cd ./samba-3.0.23d/source
fc5#> ./configure --prefix/usr/local/samba  ; make ; make install
fc5#> cp /usr/local/samba/lib/smb.conf /usr/local/samba/lib/smb.conf.ori
fc5#> ln -s /usr/local/samba/lib/smb.conf /etc/samba/smb.conf
      (Reference : /root/samba-3.0.23d/packaging/RedHat-9/smb.conf)
-------------------------------------------------------
#### Samba ver 3.0.23d configuration file ####

#### Default Setting --------------------------
[global]
workgroup     = workgroup
netbios name  = yourname

server string = "yourname"

# Client lang code EUC_KR (CP949)
client code page = 949
dos charset = 949
unix charset=euc-kr


printcap name = /etc/printcap
load printers = no
log file      = /var/log/samba/log.%m
max log size  = 50
security      =  user
encrypt passwords = yes
username map      =/etc/samba/smbusers
smb passwd file   = /etc/samba/smbpasswd
socket options    = TCP_NODELAY
#remote announce   = 10.88.165. 192.168.0. 10.88.166.
dns proxy         = no
preserve case     = yes
#### share directory --------------------------
[homes]
comment = Home Directories
browseable = no
writeable = yes
valid users = %S

[data]
comment=/data
path=/data
browseable = yes
writable = yes
#write list = wogns73
printable = no

-----------------------------------------------------------

(참고) samba 에서 공유디렉토리를 지정할 때 사용하는 옵션 설명
- read only : 공유 디렉토리를 읽기만 가능하게 할 것인지를 결정
- writable, write ok : 공유 디렉토리를 쓰기 가능하게 할 것인지를 결정
- valid users : 공유 디렉토리에 로그인할 수 있는 사용자를 결정
- public, guest ok : 다른 사용자들이 이용하게 할 지를 결정
- browseable : 공유 디렉토리의 리스트를 보여줄 지를 결정
- printable : 공유 디렉토리에 스풀 파일을 지정할 것인지를 결정

- path : 공유할 디렉토리의 절대경로를 지정
- comment : 간단한 설명을 적음
- create mask, create mode : 파일을 생성할 때의 모드를 umask 결정.
- write list : 쓰기가 가능한 특정 사용자를 지정


fc5#> ln -s /usr/local/samba/sbin/smbd /usr/sbin/smbd
fc5#> ln -s /usr/local/samba/sbin/nmbd /usr/sbin/nmbd
fc5#> ln -s /usr/local/samba/bin/smbpasswd /usr/bin/smbpasswd

fc5#> vi /etc/xinet.d/smb
     (Reference : /root/samba-3.0.23d/packaging/RedHat-9/smb.init)
-----------------------------------------------------------
#!/bin/sh
#
# chkconfig: - 91 35
# description: Starts and stops the Samba smbd and nmbd daemons
#              used to provide SMB network services.
#
# pidfile: /var/run/samba/smbd.pid
# pidfile: /var/run/samba/nmbd.pid
# config:  /etc/samba/smb.conf


# Source function library.
if [ -f /etc/init.d/functions ] ; then
  . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
  . /etc/rc.d/init.d/functions
else
  exit 0
fi

# Avoid using root's TMPDIR
unset TMPDIR

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

if [ -f /etc/sysconfig/samba ]; then
   . /etc/sysconfig/samba
fi

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

# Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0

RETVAL=0


start() {
        KIND="SMB"
        echo -n $"Starting $KIND services: "
        daemon smbd $SMBDOPTIONS
        RETVAL=$?
        echo
        KIND="NMB"
        echo -n $"Starting $KIND services: "
        daemon nmbd $NMBDOPTIONS
        RETVAL2=$?
        echo
        [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb ||
           RETVAL=1
        return $RETVAL
}

stop() {
        KIND="SMB"
        echo -n $"Shutting down $KIND services: "
        killproc smbd
        RETVAL=$?
        echo
        KIND="NMB"
        echo -n $"Shutting down $KIND services: "
        killproc nmbd
        RETVAL2=$?
        [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb
        echo ""
        return $RETVAL

}

restart() {
        stop
        start
}

reload() {
        echo -n $"Reloading smb.conf file: "
        killproc smbd -HUP
        RETVAL=$?
        echo
        return $RETVAL
}

rhstatus() {
        status smbd
        status nmbd
}


# Allow status as non-root.
if [ "$1" = status ]; then
       rhstatus
       exit $?
fi

# Check that we can write to it... so non-root users stop here
[ -w /etc/samba/smb.conf ] || exit 0

 

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  reload)
        reload
        ;;
  status)
        rhstatus
        ;;
  condrestart)
        [ -f /var/lock/subsys/smb ] && restart || :
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
        exit 1
esac

exit $?

---------------------------------------------------------------------------

fc5#> ln -s /etc/init.d/smb /etc/rc3.d/S99smb
fc5#> ntsysv
fc5#> smbpasswd -a system.ac.id
fc5#> /etc/init.d/smb start
fc5#> /usr/local/samba/bin/testparm
fc5#> pstree -p | grep smb

end of line.

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,134 명
  • 현재 강좌수 :  36,188 개
  • 현재 접속자 :  385 명