DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-08-30 07:07:15

kennedy101
Member
Registered: 2008-09-16
Posts: 48

Printer fails with better samba (chroot), but works fine in stock samb

Setup:
--Chroot (newly updated lenny).
--Printer HP 1020, yes it’s GDI and I push the firmware to the printer. The printer spools  up when the firmware is loaded.

I am having problems getting my printer to work when I kill the stock samba process and then start the chroot samba process. The odd part is that if I leave the stock samba process intact, the printer works even after chroot. But, when I kill the stock samba and load better samba loaded in lenny the printer fails. Here’s the error seen in /var/log/samba/log.smbd.

sh: /usr/local/LPRng/bin/lpq: No such file or directory
sh: /usr/local/LPRng/bin/lpr: No such file or directory

I will note that I pretty much copied the stock smb.conf files and removed the web page and Volume_2 shares. I modified the Volume_1 share to a new root directory on the chroot filesystem (/samba-mnt). See smb.conf at end of post.

Initially I just copied the contents of /mnt/root/usr/local/LPRng/bin/   --to--   /usr/local/LPRng/bin, but they were symbolic links.
wheezy1:/mnt/root/usr/local/LPRng/bin# ls -ail
1751 lrwxrwxrwx 1 root root   19 Aug 29 23:18 lpq -> /sys/crfs/LPRng/lpq
1752 lrwxrwxrwx 1 root root   19 Aug 29 23:18 lpr -> /sys/crfs/LPRng/lpr
1753 lrwxrwxrwx 1 root root   20 Aug 29 23:18 lprm -> /sys/crfs/LPRng/lprm

Next I tried copying the files from /sys/crfs/LPRng/   --to--   /usr/local/LPRng/bin,  but this didn’t resolve either (note, chroot fun_plug mount --binds /sys/ before chroot to /sys/ after chroot)

--------Code From chroot fun_plug-------
export DISK1=/mnt/HD_a2
export DISK2=/mnt/HD_b2
export DISK4=/mnt/HD_a4
export LPRDIR=/mnt/HD_a2/linux/usr/local/LPRng
export DISTDIR=linux

cd $DISK1

mount --bind $DISK1 $DISTDIR$DISK1
mount --bind $DISK2 $DISTDIR$DISK2
mount --bind $DISK4 $DISTDIR$DISK4
mount --bind $LPRDIR $DISTDIR$LPRDIR
mount --bind / $DISTDIR/mnt/root
mount --bind /dev $DISTDIR/dev
mount --bind /sys  $DISTDIR/sys
mount --bind /sys/crfs $DISTDIR/sys/crfs
--------Code From chroot fun_plug-------

Here you can see that the files samba complains are not present are now there.

wheezy1:/usr/local/LPRng/bin# ls -ail
4982172 -rwxr-xr-x 1 root staff 20335 Aug 30 04:55 lpq
4982173 -rwxr-xr-x 1 root staff 43500 Aug 30 04:55 lpr
4982174 -rwxr-xr-x 1 root staff 16206 Aug 30 04:55 lprm


I’m at a loss how to get the printer working using better samba. The reason for not using the stock samba is to hide the files in /mnt/HD_a2/ (fun_plug, linux folder, etc) from the family. Also I want only one root directory seen in the windows share. This way the USB drives that I mount can be added to the share easily.

Any help getting a printer to work in the new samba would be appreciated.


-----smb.conf----
[ global ]
interfaces = egiga0
unix charset = UTF8
workgroup = workgroup
netbios name = wheezy1
server string = NAS 1
hosts allow =
hosts deny =
security = SHARE
encrypt passwords = yes
max log size = 0
socket options = TCP_NODELAY SO_RCVBUF=65536 SO_SNDBUF=65536
max xmit = 65535
create mask = 0777
directory mask  = 0777
force create mode = 0777
force directory mode = 0777
load printers = Yes
printcap name = /usr/local/LPRng/etc/printcap
min print space = 2000
max print jobs = 1000
printing = lprng
print command = /usr/local/LPRng/bin/lpr -P%p -r %s
lpq command = /usr/local/LPRng/bin/lpq -P%p
lprm command = /usr/local/LPRng/bin/lprm -P%p %j
lppause command = /usr/local/LPRng/sbin/lpc hold %p %j
lpresume command = /usr/local/LPRng/sbin/lpc release %p %j
queuepause command = /usr/local/LPRng/sbin/lpc -P%p stop
queueresume command = /usr/local/LPRng/sbin/lpc -P%p start
use sendfile =yes



[printers]
path = /mnt/HD_a4/.lpd
guest ok = Yes
printable = Yes
use client driver = Yes
browseable = No

[ wheezy_nas1 ]
comment =
path = /samba-mnt
valid users =
read only = no
guest ok = yes
oplocks = no
map archive = no
----------end smb.conf----------



Just to be certain there is no doubt that the files are present that smb.conf references here’s the ls from each directory.

wheezy1:/usr/local/LPRng# ls -ailR /usr/local/LPRng/
/usr/local/LPRng/:
4982171 drwxr-sr-x  2 root staff 4096 Aug 30 05:54 bin
4982177 drwxr-sr-x  2 root staff 4096 Aug 30 02:22 etc
4982175 drwxr-sr-x  2 root staff 4096 Aug 30 05:56 sbin

/usr/local/LPRng/bin:
4982172 -rwxr-xr-x 1 root staff 20335 Aug 30 05:54 lpq
4982174 -rwxr-xr-x 1 root staff 43500 Aug 30 05:54 lpr
4982173 -rwxr-xr-x 1 root staff 16206 Aug 30 05:54 lprm

/usr/local/LPRng/etc:
4982178 -rwxr--r-- 1 root staff 18887 Aug 30 02:22 lpd.conf
4982179 -rwxr--r-- 1 root staff 11425 Aug 30 02:22 lpd.perms
4982180 -rwxr--r-- 1 root staff   123 Aug 30 02:22 printcap
4982181 -rwxr--r-- 1 root staff   123 Aug 30 02:22 printcap_a4

/usr/local/LPRng/sbin:
4982176 -rwxr-xr-x 1 root staff 22176 Aug 30 05:56 lpc

wheezy1:/mnt/HD_a4# ls -ail /mnt/HD_a4/
75481 drwxrwxrwx 2 root root 1024 Aug 30 05:57 .lpd
120361 drwx------ 5 root root 1024 Jan  7  2009 .systemfile


DNS 323 (Hardware B1, Firmware 1.06). 2x 1.5TB Seagate HDs.
Chroot Debain (Lenny) on USB (not reloaded). Edna server. USB print server. USB drives added to samba share. All init.d scripts in place.
Future projects: FFP reloaded then chroot on B1 hardware.

Offline

 

#2 2009-08-31 23:12:20

kennedy101
Member
Registered: 2008-09-16
Posts: 48

Re: Printer fails with better samba (chroot), but works fine in stock samb

Seems that this helped to resolve

apt-get install lprng


Side note: if you'd like to use cups then you'll need to do this

ln -s /dev/urandom /dev/random


I now have CUPS and lprng running on chroot debain. A "lpstat -p" shows the following
wheezy1:~# lpstat -p
printer lp@wheezy1 unknown state. enabled since Aug 31 21:10:51 2009. available
Printer: lp@wheezy1 'USB Printer'
Queue: no printable jobs in queue



Other conf files


wheezy1:~# cat /etc/lprng/lpd.conf
# LPRng for Debian GNU/Linux
# /etc/lprng/lpd.conf
# See lpd.conf(5) and /usr/share/doc/lprng/examples/lpd.conf.gz
#



wheezy1:~# cat /etc/printcap
lp|USB Printer:
        :sh:
        :ml=0:
        :mx=0:
        :sd=/mnt/HD_a4/.lpd:
        :lp=/dev/usblp0:


That seems to be what fixed all my grief... Hope this helps someone else.


DNS 323 (Hardware B1, Firmware 1.06). 2x 1.5TB Seagate HDs.
Chroot Debain (Lenny) on USB (not reloaded). Edna server. USB print server. USB drives added to samba share. All init.d scripts in place.
Future projects: FFP reloaded then chroot on B1 hardware.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB