우분투 기준으로
/etc/samba/smb.conf 에 보면 프린터 항목이 다음과 같이 기술되어 있다.

[printers]
        comment = All Printers
        browseable = no
        path = /var/spool/samba
        printable = yes
;       guest ok = no
;       read only = yes
        create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers
;       browseable = yes
;       read only = yes
;       guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin 

위의 경로에는 다음과 같은 디렉토리 들이 존재하는데. 전부 비어있다.
$ cd /var/lib/samba/printers/
$ ll
drwxr-xr-x 11 root root  4096 2011-05-06 17:35 ./
drwxr-xr-x  5 root root  4096 2010-10-28 14:39 ../
drwxr-xr-x  2 root root  4096 2010-09-10 03:33 COLOR/
drwxr-xr-x  2 root root  4096 2010-09-10 03:33 IA64/
drwxr-xr-x  2 root root  4096 2010-09-10 03:33 W32ALPHA/
drwxr-xr-x  2 root root  4096 2010-09-10 03:33 W32MIPS/
drwxr-xr-x  2 root root  4096 2010-09-10 03:33 W32PPC/
drwxr-xr-x  2 root root  4096 2011-05-06 17:35 W32X86/
drwxr-xr-x  2 root root  4096 2010-09-10 03:33 WIN40/
drwxr-xr-x  2 root root  4096 2010-09-10 03:33 x64/ 

도대체 어디에 어떻게 넣으란거야 -_-

[링크 : http://www.linuxtopia.org/.../samba_reference_guide/29_CUPS-printing_105.html]
 [링크 : http://www.enterprisenetworkingplanet.com/.../Push-Windows-Printer-Drivers-with-CUPS.htm]
[링크 : http://www.cups.org/documentation.php/man-cupsaddsmb.html]
[링크 : https://wiki.samba.org/index.php/Samba_as_a_print_server]

21.5.1 Point'n'Print Client Drivers on Samba Servers
[링크 : http://www.scribd.com/doc/49933038/246/Point'n'Print-Client-Drivers-on-Samba-Servers] << 플래시 pdf
[링크 : http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/classicalprinting.html] << text 

---
$ rpcclient -U'Danka%xxxx' -c 'getdriver "Heidelberg Digimaster 9110 (PS)" 3' TURBO_XP
                로그인용아이디         드라이버정보 "공유 프린터 이름" 출력레벨        컴퓨터이름

\\PC_NAME\COLOR_PRINTER 라는 경로가 존재한다면
$ rpcclient -N -c 'getdriver "COLOR_PRINTER" 3' PC_NAME
이라고 입력을 하면된다. (물론 RPC를 통해 얻으므로 윈도우 시스템에 query를 해서 드라이버를 추출한다)
 

--- 2011.05.07 추가

문서를 보고 따라하는데 무언가 빼먹은게 있는듯 -_-
일단 smbclient를 이용해서 복사를 했지만 등록을 하지 않아서 안되는 것으로 보인다.
\\TURBO_XP\Heidelberg Digimaster 9110 (PS) 의 드라이버 정보를 보고
rpcclient -U'Danka%xxxx' -c 'getdriver "Heidelberg Digimaster 9110 (PS)" 3' TURBO_XP

\\TURBO_XP\print$ 에 공유된 드라이버 파일중 일부를 복사한다.
smbclient //TURBO_XP/print\$ -U'Danka%xxxx' -c 'cd W32X86/2;mget HD*_de.* hd*ppd Hd*_de.* Hddm*dll HDN*Aux.DLL'

\\SAMBA-CUPS\print$ 에 복사한 드라이버 파일을 넣어주고
smbclient //SAMBA-CUPS/print\$ -U'root%xxxx' -c \
'cd W32X86; put HDNIS01_de.DLL; \
put Hddm91c1_de.ppd; put HDNIS01U_de.DLL;        \
put HDNIS01U_de.HLP; put Hddm91c1_de.DLL;        \
put Hddm91c1_de.INI; put Hddm91c1KMMin.DLL;      \
put Hddm91c1_de.dat; put Hddm91c1_de.dat;        \
put Hddm91c1_de.def; put Hddm91c1_de.hre;        \
put Hddm91c1_de.vnd; put Hddm91c1_de.hlp;        \
put Hddm91c1_de_reg.HLP; put HDNIS01Aux.dll;     \
put HDNIS01_de.NTF'

\\SAMBA-CUPS\print$ 에 파일이 들어갔는지 확인하고
smbclient //SAMBA-CUPS/print\$ -U 'root%xxxx' -c 'cd W32X86; pwd; dir; cd 2; pwd; dir'

\\SAMBA-CUPS\print$ 에 드라이버를 추가(등록)한다.
rpcclient -Uroot%xxxx -c 'adddriver "Windows NT x86" \
  "dm9110:HDNIS01_de.DLL: \
  Hddm91c1_de.ppd:HDNIS01U_de.DLL:HDNIS01U_de.HLP:   \
  NULL:RAW:Hddm91c1_de.DLL,Hddm91c1_de.INI,          \
  Hddm91c1_de.dat,Hddm91c1_de.def,Hddm91c1_de.hre,   \
  Hddm91c1_de.vnd,Hddm91c1_de.hlp,Hddm91c1KMMin.DLL, \
  HDNIS01Aux.dll,HDNIS01_de.NTF,                     \
  Hddm91c1_de_reg.HLP' SAMBA-CUPS

\\SAMBA-CUPS\print$ 에 제대로 들어갔는지 확인하고
smbclient //SAMBA-CUPS/print\$ -Uroot%xxxx' -c 'cd W32X86;dir;pwd;cd 2;dir;pwd' 

유닉스에서 확인하고
rpcclient -U'root%xxxx' -c 'enumdrivers' SAMBA-CUPS

윈도우에서 다시 한번 더 확인한다.
rundll32 printui.dll,PrintUIEntry /s /t2 /n\\SAMBA-CUPS 

'프로그램 사용 > SMB(Samba)' 카테고리의 다른 글

samba에 갑작스러운 "엑세스 거부"  (0) 2011.11.23
삼바를 SSH통해 공유하기  (0) 2011.08.23
samba on Ubuntu 10.04 LTS  (0) 2010.11.11
cifsd  (0) 2010.03.18
삼바 3.0.x 에서 3.4.0 으로 사용자 이전하기  (0) 2010.02.05
Posted by 구차니
우분투 10.04 에서의 기본 samba 저장시의 계정은 nobody:nogroup 으로 되어있다.
이녀석을 변경하기 위해서는

cat /etc/samba/smb.conf

[global]
guest account = 유저계정

guest account를 입력해주면 된다.

[링크 : https://help.ubuntu.com/community/Samba/SambaServerGuide]

'프로그램 사용 > SMB(Samba)' 카테고리의 다른 글

삼바를 SSH통해 공유하기  (0) 2011.08.23
삼바 프린터 드라이버 경로 설정하기  (0) 2011.05.06
cifsd  (0) 2010.03.18
삼바 3.0.x 에서 3.4.0 으로 사용자 이전하기  (0) 2010.02.05
SPNEGO, NTLMSSP  (0) 2009.12.21
Posted by 구차니
Unfortunately the bug is still observed - i did some additional triaging.

* The bug is seen only when the samba share exported is on a vfat file system
    - for ext2 and ext3 the large sized copy succeeds without fail.

* I also tried using the samba package from debian-arm repositories(lenny-stable)
    - but there also the problem is seen.

* Even if the error is thrown up - the file is still being copied in the background - or ftruncate'ing in the background (I suspect it is only ftruncating and filling the space with zeroes because of two reasons - one the md5sums do not match afterwards and two the code seems to be doing the same thing) - but as previously stated adding a patch to always call ftruncate64() in sys_ftruncate() does not fix the problem.

[링크 : http://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg1902987.html]

SH4 시스템에서 smbd / nmbd 조합으로
USB 메모리를 vfat으로 사용하여, 원격지에서 파일을 복사할경우
20MB 이상의 파일을 복사하려고 시도하면 죽는 문제가 발생했다.

임베디드 장비라서, 메모리 부족 에러와 함께 DMA 에러가 발생했지만,
이러한 문제가 발생하기전 vfat으로 rw가 아닌 ro로 mount 되는 것을 봐서
다른 문제나 버그가 있는 것으로 생각이 된다.
Posted by 구차니
# cat log.smbd
[2009/08/15 00:00:07,  0] lib/pidfile.c:121(pidfile_create)
  ERROR: smbd is already running. File /usr/local/samba/var/locks/smbd.pid exists and process id 687 is running.

삼바가 구동중에 제대로 종료되지 않고 재가동 될경우
$PIDDIR/smbd.pid
$PIDDIR/nmbd.pid

파일이 남아 있다 보면, 위와 같이 이미 구동중으로 착각을 하고
smbd나 nmbd를 구동하는데 실패를 한다.

fork() / execl() 로 구동시에는
waitpid() 에서 벗어 나지 못하고 멈추는 현상이 발생했다.





결론 : 혹시 모르니 종료가 불확실한 시스템(임베디드?)에서는 삼바 구동 이전에 pid 파일을 지워주도록 하는게 좋을듯 하다.
Posted by 구차니
삼바를 사용한다는 말은,
일반적으로 서버로 사용한는 의미인데,
그렇다고 해서 윈도우에서 아이피를 바꾸면 안되는건 아니다.


각설하고, 삼바를 구성하는 프로세스로는
nmbd
smbd
winbind 가 있다.

그 중에서 nmbd가 네트워크상에서 이름을 알리는 녀석인데,
아이피가 바뀔경우, smbd는 다시 시작안하고, nmbd만 다시 시작하면
약간의 시간이 흐른뒤 파일 공유가 연결된다.
(winbind는 안써봐서 모름)

물론 아이피가 바뀌어서 네트워크 갱신되는 동안은 접속이 끊어진다.
Posted by 구차니
[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.

[링크 : http://forums.opensuse.org/network-internet/413860-errors-log-smbd.html]

[링크 : http://threebit.net/mail-archive/samba/msg01516.html]
Posted by 구차니
# 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

[링크 : http://archives.devshed.com/forums/samba-120/panic-failed-to-set-gid-on-mipsel-1742988.html]



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로 했을시에 위와 같은 에러가 발생하지 않는 것으로 생각된다.
Posted by 구차니
# 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 하지 않아도 된다.
Posted by 구차니
/etc/services
netbios-ns      137/tcp                         # NETBIOS Name Service
netbios-ns      137/udp
netbios-dgm     138/tcp                         # NETBIOS Datagram Service
netbios-dgm     138/udp
netbios-ssn     139/tcp                         # NETBIOS session service
netbios-ssn     139/udp

microsoft-ds    445/tcp
microsoft-ds    445/udp



삼바라는 녀석.. 포트를 참 여러가지 쓰기도 한다.
# smbtree -N
timeout connecting to 192.168.10.123:445

위와 같은 에러가 발생하거나 삼바 접속이 안되면
445번 포트가 설정되어 있는지 /etc/services 에서 확인해야 한다.
Posted by 구차니
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.

Posted by 구차니