  SAMBA ̿  

   âwinchild@hanimail.net
  1999 8 17 ver0.01
  SGML :  mailto:kaien@metal.me.pusan.ac.kr
  ______________________________________________________________________

  

  1. SAMBA LINUX    
  2. SAMBA  REMOTE-PC    

  ______________________________________________________________________

  1.  SAMBA LINUX    

  н ͸ Ϸ /etc/printcap  ؾ Ѵ.

   

         lp|lj|HP LJ6P:\
                :lp=/dev/lp0:\
                :sd=/var/spool/lpd/lj:\
                :mx#0:sh:sf:

    |  е lp  lj   Ī̴. lpr -P <name>
   name   ̿ȴ. lp=/dev/lp0   device
  Ī̴.  Ʈ Ͱ پ ִ

         # cat /etc/hosts > /dev/lp0

    ̷  Ȯ  ִ. ̰ hosts ؽƮ
   μǸ Ϳ  ̻ °̴.

  sd=/var/spool/lpd/lj  spool 丮μ  μҽÿ ӽ÷
    ̴.  ش path  丮  ƾ Ѵ.
  mx#0   ũ⸦   ɼ̸ sh 뷮 
   ʴ ɼ̸ (Windwos ּ ϴ  뷮 ̹
  ̹Ƿ ϸ ȵȴ.) sf ɼ  Ŀ form feed
  ڸ   ̴. (̰    ½ÿ
   ϳ  ȴ. ׷ UNIX form feed 
  ASCII ½ÿ ʿϴ.) sh, sf ɼ Ǹ false  Ǵ
  ɼ̴. (man printcap )

  printcap   Ǿ lpc   񽺰
  ǵ Ѵ.

         # lpc

         lpc> restart all

         lpc > status

         lp:
              queuing is enabled
              printing is enabled
              no entries
              no daemon present
         lpc>

   Ȱ ȮεǸ  Ǵ ȮѴ. ̶ sf ɼ false
  ̹Ƿ ԵǾ Ƿ Ϲ ASCII     ^L (form feed)
  ڸ Ͽ lpr  ̴ ȮѴ.

         # lpr -P lp /tmp/testfile

   μǾ SAMBA  Ѵ. Ϲ ù 
   Ǿ ִ  ° ϰ

         path = /var/spool/lpd/lj
         printer name = lj
         print command = lpr -r -h -P %p %s

    /etc/printcap   sd  prnter name  ġϵ Ͽ
  Ѵ. print command   μμ ״ μǴ
  SHELL   Ѵ.

         # lpr -r -h -P <printer name> <μ ϸ>

  ̷ Ͽ μⰡ Ǹ samba Ͽ μϸ  ϰ ȴ.
   μⰡ   /var/log/samba  ִ α  ϵ
  Ѵ. μⰡ  쿡 PC  ۵  spool 丮
  ġϰ ǹǷ lpr μ μ⸦ ѺƼ  µǰ
  Ǹ    ִ°̹Ƿ  Ȯ 
  Ѵ. ۵Ǵ     Ʒ  Ѵ.

         PC Client   -> Sambar Server ----> lpr ------------> Printer

         (PC)     (/etc/smb.conf)         (/etc/printcap)

   PC μ⸦ ϸ Printer Driver    ̹
  ϰ LanManager  Ŷ SAMBA   ̰ smb.conf 
   spool 丮  lpr  μ⸦ Ѵ. lpr 
  printcap   ɼǿ  Ϳ μ  ȴ.

  2.  SAMBA  REMOTE-PC    

  PC  Ʈ ͸ LINUX SAMBA  ϴ  
  ٸ.  ̰ LINUX printcap ִ ͸ ̿ϴ  
  Ʈ ٽ Ͱ  PC Ѵ.

         PC Client   -> Sambar Server ----> lpr ------------> smbprint -----> PC ----> Printer

         (PC)     (/etc/smb.conf)         (/etc/printcap)       .config              (ͼ)

     lpr ɽÿ ϴ printcap Ͽ ͸ ϴ if
  ɼǿ smbprint ϵ ϰ  smbprint smbclient
  ȣϿ PC  Ѵ. ̶ PC Ҽ ִ  
  Ͽ .config Ͽ , 񽺸  йȣ  Ƽ
  smbclient ش ȹ  ֵ Ѵ.

         lp|lj|HP LJ6P:\
                :lp=/dev/null:\
                :sd=/var/spool/lpd/lj:\
                :mx#0:sh:sf:\ :if=/usr/bin/smbprint:
                :af=/var/spool/lpd/lp/acct:

  ̶ LINUX Ͱ   ƴϹǷ lp  null ̽
  Ѵ. if  ͷμ smbprint script ̴.  ο
    , йȣ  smbclient ϴ script
  ԵǾ ִ.

     -- տ  ---

     eval `cat $config_file`
     #
     # Some debugging help, change the >> to > if you want to same space.
     #
     echo "server $server, service $service" >> $logfile

     (
     # NOTE You may wish to add the line `echo translate' if you want automatic
     # CR/LF translation when printing.
     # echo translate
     echo "print -"
     cat
     ) | /usr/bin/smbclient "\\\\$server\\$service" $password -U $server -N -P >> $lo
     gfile

  $config   spool 丮 .config Ϸ Ѵ. (
  κ Ȯ) .config 

         server=PC_SERVER
         service=PR_SHARENAME
         password="password"

    ASCII Ϸ Ѵ. password   "( ̼)
   ݾƾ ϸ йȮ  ÿ ""  ǥѴ. ̺κп
    ۵  ÿ spool Ͽ   
  smbclient  PC μǴ Ȯ .

         # smbclient '\\mimas\lj' <passwd> -U mimas -N -P

  ̿  ؼ μⰡ ȴٸ   谡  
   smbclient  ʴ°̹Ƿ LOG ϵ 
  캸 Ѵ. μⰡ  ʴ´ٸ Ͱ  PC 
  ִ°   Ƿ ش PC  踦
  Ȯ  Ѵ.  

