[2009/11/11 08:17:07, 0] lib/util_sock.c:730(write_data)
[2009/11/11 08:17:07, 0] lib/util_sock.c:1468(get_peer_addr_internal)
getpeername failed. Error was Transport endpoint is not connected
write_data: write failure in writing to client 0.0.0.0. Error Transport endpoint is not connected
[2009/11/11 08:17:07, 0] smbd/process.c:62(srv_send_smb)
Error writing 4 bytes to client. -1. (Transport endpoint is not connected)
위와 같은 에러가 발생한다면
/usr/local/samba/lib/smb.conf 파일에
smb ports = 139 를 넣어주면 해결이 된다고 한다.
These are generally innocuous. Windows XP will try to connect on both ports 139 and 445. Once an XP client connects on one of these ports, it silently drops the other. If you want to get rid of the error in your log, or just verify my answer, add the following parameter to the Global Section of /etc/samba/smb.conf , then restart samba.
I found a workaround which involves disabling Opportunistic Locking. This will have a small performance impact, but at least the thing wont hang up and use 100% CPU for no goddamn reason. Yes, this article has an angry tone, because this issue has eaten way too much of my time today.
To disable Opportunistic Locking, you have to set the contents of the file “/proc/fs/cifs/OplockEnabled” to 0. This file only exists after the cifs module has been loaded, and will be replaced if the module is unloaded and reloaded. Thus, I configured my /etc/rc.local script (use whatever equivalent your distro has to a startup script) to both load the cifs module and set the contents of said file:
이 문서 앞부분에 나열한 Windows 운영 체제 중 하나를 실행하는 SMB(서버 메시지 블록) 클라이언트에서는 oplocks(Opportunistic Locking)가 기본적으로 설정됩니다. oplocks를 통해 클라이언트는 파일을 잠가 다른 사용자가 파일을 변경하는 위험 없이 로컬로 정보를 캐시할 수 있습니다. 이 경우 대부분의 파일 작업에서 성능이 향상되지만, 다른 사용자가 해당 파일에 대한 액세스를 요청할 때 oplocks를 부여하는 서버에서 해당 잠금의 위반을 관리해야 하기 때문에 일부 작업에서는 성능이 저하될 수도 있습니다.
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MRXSmb\Parameters\
OplocksDisabled REG_DWORD 0 또는 1
기본값: 0(해제되지 않음)
참고 OplocksDisabled 레지스트리 값은 원격 파일에 대해 oplocks를 요청하거나 요청하지 않도록 Windows 클라이언트를 구성합니다.
CIFS VFS: No response to cmd 46 mid 21391
CIFS VFS: Send error in read = -11
CIFS VFS: No response to cmd 47 mid 21392
CIFS VFS: Write2 ret -11, written = 0
CIFS VFS: Write2 ret -9, written = 0
CIFS로 samba 를 공유해서 사용할때 이러한 에러가 발생을 하면서 삼바서버에 파일을 장시간 쓰지 못하는 문제가 있다.
위의 방법으로 바꾸고 해봐도 그리 차이는 없어 보이는데 흐음..
# more /usr/local/samba/var/log.smbd
[2009/11/08 23:55:51, 0] lib/util_sec.c:assert_gid(113)
Failed to set gid privileges to (-1,65534) now set to (0,0) uid=(0,0)
위와 같은 에러가 발생하는 것은,
User ID / Group ID 설정상의 문제로 생각이 된다.
해결 방법은
좀.. 미심쩍지만
# vi /usr/local/samba/lib/smb.conf
[global]
guest account = root
20091111 추가
Failed to set gid privileges to (-1,65534) now set to (0,0) uid=(0,0)
한글로 번역하자면,
현재 gid (0,0) uid (0,0)으로 설정되어 있는데 (-1,65534) 로 gid 권한을 설정하는데 실패를 했다는 의미이다.
현재 gid = 0, uid = 0 이고 이것은 일반적인 unix 시스템에서 root의 uid / gid 값이다.
그런 이유로, guest account 를 root로 했을시에 위와 같은 에러가 발생하지 않는 것으로 생각된다.
# more /usr/local/samba/var/log.smbd
[2009/11/08 23:55:51, 0] smbd/service.c:1005(make_connection_snum)
'/tmp' does not exist or permission denied when connecting to [IPC$] Error was No such file or directory
log.smbd 에서 위와 같은 에러가 발생되고,
/usr/local/samba/var/cores/smbd/core 파일이 생성되며,
smbtree 실행시에는 "failed tcon_X with NT_STATUS_BAD_NETWORK_NAME" 에러가 발생을 한다.
위의 에러는 간단하게 /tmp 디렉토리를 생성하거나, 퍼미션을 수정하면 해결된다.
# mkdir /tmp
20091117 추가
MTD에서 작동 시킬경우 tmp는 굳이 writable 하지 않아도 된다.
MTD에서 삼바를 구동하는데 위와 같은 에러가 발생하면, 말 그대로 MTD의 남은 공간이 없다는 의미이다.
파티션을 조절하거나, 파일 용량을 줄이거나 조치를 취해야 한다.
# ./smbd -S -F Unable to setup corepath for smbd: No space left on device
smbd version 3.4.0 started.
Copyright Andrew Tridgell and the Samba Team 1992-2009
standard input is not a socket, assuming -D option
# ./smbd -S -F
Unable to setup corepath for smbd: No space left on device
smbd version 3.4.0 started.
Copyright Andrew Tridgell and the Samba Team 1992-2009 tdb(unnamed): tdb_open_ex: failed to truncate /usr/local/samba/var/locks/messages.tdb: No space left on device ERROR: Failed to initialise messages database: No space left on device
messaging_tdb_init failed: NT_STATUS_DISK_FULL
Could not init smbd messaging context.