Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
Pages: 1
i hate disk spin ups when not needed
when printing, lpd uses queue directory to queue files to print. this directory is located on hdd (HD_a4/.lpd) and indeed, the disk spins up whenever you are printing..
so here is quick explanation how to move .lpd queue directory from HD_a4 to USB stick (i guess by now you realized you do need one for this to work )
(you could use ram disk but there you have only about 2mb free so it's not recommended)
bold are the new changes i forgot to mention in first revision
ok, so first you need to create new directories for lpd to use: i'm using /ffp because that one already points on USB (everything runs from there)
#killall lpd
#mkdir /ffp/var/spool
#chmod 777 /ffp/var/spool
#mkdir /ffp/var/spool/lpd
#chmod 777 /ffp/var/spool/lpd
copy the printcap file (settings) and queue so we have it ready after reboot:
#cp /mnt/HD_a4/.lpd/* /ffp/var/spool/lpd
#cp /usr/local/LPRng/etc/printcap /ffp/var/spool/printcap
#vi /ffp/var/spool/printcap
just change the directory inside, mine looks like this:
lp|USB Printer:\ :sh:\ :ml=0:\ :mx=0:\ :sd=/ffp/var/spool/lpd:\ :lp=/dev/usblp0:\
copy the smb.conf (samba settings) file so we have it ready after reboot:
#cp /etc/samba/smb.conf /ffp/etc/smb.conf
edit the [printers] section in smb.conf to point to your directory
#vi /ffp/etc/smb.conf
[ printers ] path = /ffp/var/spool/lpd guest ok = yes printable = yes use client driver = yes browseable = no
after all this editing, copy the files back to ramdrive, restart smbd, restart lpd and that's it :
#cp /ffp/var/spool/printcap /usr/local/LPRng/etc/printcap
#cp /ffp/etc/smb.conf /etc/samba/smb.conf
#smb restart
#lpd&
for the permanent change put these lines in your fun_plug
killall lpd
cp /ffp/var/spool/printcap /usr/local/LPRng/etc/printcap
cp /ffp/etc/smb.conf /etc/samba/smb.conf
smb restart
lpd&
add them further down in the fun_plug file, i have them right above the #run commands ($FFP_RC run)
enjoy
Last edited by SilentException (2008-06-25 11:03:38)
Offline
Very nice!
Offline
SilentException wrote:
.....for the permanent change put these lines in your fun_plug
killall lpd
cp /ffp/var/spool/printcap /usr/local/LPRng/etc/printcap
smb restart
lpd&
The above noted changes have been made however the ffp.log file reports an error and printing continues from HD_a4.
The ffp.log shows the following;
killall: No such file or directory
$Shutting down SMB services:
$Shutting down NMB services:
$Starting SMB services:
$Starting NMB services:
Fatal error - Another print spooler active, possibly lpd process '1669'
The fun_plug file was revised to include the following lines;
USB_LPD_QUEUE=/mnt/USB/ffp/var/spool # Establish availability of USB Drive and move print queue if available if [ -d $USB_LPD_QUEUE ]; then echo "* Moving Print Queue to USB Drive" killall lpd cp $USB_LPD_QUEUE/printcap /usr/local/LPRng/etc/printcap smb restart lpd& fi
The printcap file was modofied to read as follows;
lp|USB Printer:\ :sh:\ :ml=0:\ :mx=0:\ :sd=/mnt/USB/ffp/var/spool/lpd:\ :lp=/dev/usblp0:\
My skills on the Linux side are very limited and I don't understand why these errors are occuring. Any help in this regard would be appreciated.
Bob Blackwell
Pickering, ON
Offline
seems to me like you've added the lines too soon in fun_plug. (before /ffp symlink is created and/or suid busybox).
try to move it bit more further in the file... i have it just above the last RC_D run... if that fails, use full path to killall (/ffp/bin/killall
also, there is one more thing i forgot to mention in the first post. in /etc/samba/smb.conf there is [ printers ] section. and the "path = " variable in there should be edited to reflect the changes too. will edit the instructions now and make sure you do that part too
Offline
Success!!
* Print Queue established on USB Drive (/mnt/USB/ffp/var/spool/lpd)
$Shutting down SMB services:
$Shutting down NMB services:
$Starting SMB services:
$Starting NMB services:
SilentException wrote:
seems to me like you've added the lines too soon in fun_plug. (before /ffp symlink is created and/or suid busybox).
try to move it bit more further in the file... i have it just above the last RC_D run... if that fails, use full path to killall (/ffp/bin/killall
My lines of code were placed at the end of the fun_plug file; same place as your's were placed. I've a sneaking suspicion the USB drive is still being set-up when the killall command was being issued. Adding the full path to the command has corrected the problem.
SilentException wrote:
also, there is one more thing i forgot to mention in the first post. in /etc/samba/smb.conf there is [ printers ] section. and the "path = " variable in there should be edited to reflect the changes too. will edit the instructions now and make sure you do that part too
There's always a slight chance the USB drive might not mount so to avoid problems two copies of the smb.conf were placed in the /ffp/etc folder. One file is named smb.conf.default, the other smb.conf.usb. The smb.conf.usb file is copied to the /etc/samba/ directory as smb.conf if the USB drive mounts successfully. As a precaution, the smb.conf.default was left unedited and is copied to the /etc/samba/ directory as smb.conf if the USB drive fails to mount. The following lines were added to the fun_plug file and start the print queue as deemed appropriate;
USB_LPD_QUEUE=/mnt/USB/ffp/var/spool <other ffp code removed for clarity purposes> # Establish availability of USB Drive and move print queue if available /mnt/USB/ffp/bin/killall lpd if [ -d $USB_LPD_QUEUE ]; then echo "* Print Queue established on USB Drive (/mnt/USB/ffp/var/spool/lpd)" cp $USB_LPD_QUEUE/printcap /usr/local/LPRng/etc/printcap cp /mnt/USB/ffp/etc/smb.conf.usb /etc/samba/smb.conf else echo "* Print Queue established on Hard Drive (/mnt/HD_a4/.lpd)" cp $USB_LPD_QUEUE/printcap /usr/local/LPRng/etc/printcap cp /mnt/HD_a2/ffp/etc/smb.conf.default /etc/samba/smb.conf fi smb restart lpd&
I see one downfall of using this approach; if I later changes Samba Shares, it will be necessary to copy and re-edit the /etc/samba/smb.conf file. Any ideas on how this can be avoided?
Bob Blackwell
Pickering, ON
Last edited by rcblackwell (2008-06-25 17:15:35)
Offline
rcblackwell wrote:
I see one downfall of using this approach; if I later changes Samba Shares, it will be necessary to copy and re-edit the /etc/samba/smb.conf file. Any ideas on how this can be avoided?
sadly, there is no cure for this. its the same if you changed your share name for example.
after editing samba shares using web interface you need to copy smb.conf to your two locations on /ffp. good thing is, in *most cases* you dont need to edit anything (just copy the file) because web interface is smart to add/edit only needed parts of smb.conf (thus keeping your changes intact).
as for the usb not mounted precaution. i have used /ffp in the scripts and /ffp (using my fun_plug) always points to the either hd or usb..
nevertheless i only use vi to edit smb.conf now coz i've added some extra features (like user level security; as opposed to default share one)..
Last edited by SilentException (2008-06-25 23:14:46)
Offline
Hi there!
Do I understand this correctly, that the Samba settings are overwritten after each boot with the backed up version? So that all possible changes are made undone? What settings are actually stored in this smb.conf?
Regards
Ben
Offline
SilentException wrote:
rcblackwell wrote:
I see one downfall of using this approach; if I later changes Samba Shares, it will be necessary to copy and re-edit the /etc/samba/smb.conf file. Any ideas on how this can be avoided?
sadly, there is no cure for this.
Don't mean to dig up an old thread, but couldn't this be cured by a simple sed command? E.g. one could do the following:
# copy existing smb.conf file
cp /etc/samba/samba.conf /mnt/USB/ffp/etc/samba.conf.default
# create a copy USB version that will be edited in place
cp /mnt/USB/ffp/etc/samba.conf.default /mnt/USB/ffp/etc/samba.conf.usb
# replace the the printer's path in place via sed
# note: since the delimitation is arbitrary; commas are used in this case
# rather than the traditional foward slashes, which otherwise would require escaping!
sed -i "s,path = /mnt/HD_a4/.lpd,path = /mnt/freebird/ffp/var/spool/lpd/," smb.conf.usb
# copy samba.conf.usb back, etc.
Or did I miss the point?
Offline
rcblackwell wrote:
I see one downfall of using this approach; if I later changes Samba Shares, it will be necessary to copy and re-edit the /etc/samba/smb.conf file. Any ideas on how this can be avoided?
Edit /etc/samba/smb.default
And update mtd1 and mtd2":
mount -t minix /dev/mtdblock0 /sys/mtd1
cp /etc/samba/smb.default /sys/mtd1/smb.default
sync
umount /sys/mtd1
mount -t minix /dev/mtdblock1 /sys/mtd2
cp /etc/samba/smb.default /sys/mtd2/smb.default
sync
umount /sys/mtd2
Offline
Pages: 1