lprng

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС для молодых и начинающих системных администраторов.

Модераторы: SLEDopit, Модераторы разделов

karpos
Сообщения: 50
ОС: archlinux

lprng

Сообщение karpos »

Немного лирики бьюсь уже не делю если не больше хочу организовать сервер печать.
Установил lprng настроил печатает только с сервера с клиентских машин не хочет логи толком не ведет точнее из нет на ошибки.

smb.conf

Код: Выделить всё

[global]
    log file = /var/log/samba/log.%m
#    socket options = TCP_NODELAY
    admin users = root
    invalid users = root
    null passwords = yes
    #domain master = no
    #netbios name = alisa
    server string = alisa
    writeable = yes
    #default = public
    #dos charset = 866
    workgroup = UST
    #os level = 255
    security = share
    #unix charset = KOI8-R
    #preferred master = yes
    max log size = 50
    map to guest = bad password
    guest account = nobody
    #wins support = Yes

    printcap name = /etc/printcap
    printing = lprng
    load printers = yes

[printers]
    print ok = yes
    guest ok = no
    writable = no
    path = /var/spool/lpd/samba

[hp1536]
    printable = yes
    comment = отдел кадров
    public = yes
    writable = no
    browseable = yes

printcap

Код: Выделить всё

# /etc/printcap: printer capability database. See printcap(5).
# You can use the filter entries df, tf, cf, gf etc. for
# your own filters. See /etc/filter.ps, /etc/filter.pcl and
# the printcap(5) manual page for further details.

#kx
kx:\
  :lp=lp=KM8BC58E@192.168.0.15

#
pr10|p1522n_1:\
  :sd=/var/spool/lpd/hp1522n_1:\
  :af=/var/spool/lpd/hp1522n_1/acct:\
  :lf=/var/spool/lpd/hp1522n_1/error:\
  :mx#0:sh:\
  :rm=192.168.0.156:rp=raw:
#
hp1536:\
  :lp=/dev/null:sh:\
  :sd=/var/spool/lpd/hp1536:\
  :af=/var/spool/lpd/hp1536/acct:\
  :mx#0:sh
  :if=/usr/bin/smbprint3:

smbprint3 этот файл я взял с рабочего сервера он я так понял нужен для печати на расширенные принтеры

Код: Выделить всё

#!/bin/sh

# This script is an input filter for printcap printing on a unix machine. It
# uses the smbclient program to print the file to the specified smb-based
# server and service.
# For example you could have a printcap entry like this
#
# smb:lp=/dev/null:sd=/usr/spool/smb:sh:if=/usr/local/samba/smbprint
#
# which would create a unix printer called "smb" that will print via this
# script. You will need to create the spool directory /usr/spool/smb with
# appropriate permissions and ownerships for your system.

# Set these to the server and service you wish to print to
# In this example I have a WfWg PC called "lapland" that has a printer
# exported called "printer" with no password.

#
# Script further altered by hamiltom@ecnz.co.nz (Michael Hamilton)
# so that the server, service, and password can be read from
# a /var/spool/lpd/PRINTNAME/.config file.
#
# In order for this to work the /etc/printcap entry must include an
# accounting file (af=...):
#
#   cdcolour:\
#    :cm=CD IBM Colorjet on 6th:\
#    :sd=/var/spool/lpd/cdcolour:\
#    :af=/var/spool/lpd/cdcolour/acct:\
#    :if=/usr/local/etc/smbprint:\
#    :mx=0:\
#    :lp=/dev/null:
#
# The /usr/var/spool/lpd/PRINTNAME/.config file should contain:
#   server=PC_SERVER
#   service=PR_SHARENAME
#   password="password"
#
# E.g.
#   server=PAULS_PC
#   service=CJET_371
#   password=""

#
# Debugging log file, change to /dev/null if you like.
#
# logfile=/tmp/smb-print.log
logfile=/dev/null


#
# The last parameter to the filter is the accounting file name.
#   Extract the directory name from the file name.
#   Concat this with /.config to get the config file.
#
eval acct_file=\${$#}
spool_dir=`dirname $acct_file`
config_file=$spool_dir/.config

# Should read the following variables set in the config file:
#   server
#   service
#   password
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 >> $logfile


есть еще фалы lpd.conf (он можно сказать пустой) и lpd.perm я их не изменял с сервера командой lpr -Pkx /root/test все печатает как на сетевые принтеры так и на расширенный а с windiws машин не хочет печатать и все куда копать.
Спасибо сказали: