Where to put "/usr/sbin/lpd"


Forum: Printers
Topic: Where to put "/usr/sbin/lpd"
started by: jhsu

Posted by jhsu on Aug. 06 2008,19:54
I know exactly how to set up the printer on my machine.  What I haven't figured out is how to keep the installation intact between boots.  So far, I have had to reinstall the printer every time I boot up.

I am aware that the file /home/dsl/.filetool.lst needs opt/printcap , opt/apsfilter , and var/spool/lpd/lp .

I am aware that the command "export PRINTER=lp" command needs to be in /home/dsl/.bashrc (contrary to what the book and the printerhowto.pdf file instruct) , and you need to be NON-ROOT in order to make this change.  I found that this command is automatically executed during bootup when in the /home/dsl/.bashrc file but is NOT executed during bootup when in the /opt/bootlocal.sh file .

Where does the "/usr/sbin/lpd" command need to go given that the bootup process seems to ignore the /opt/bootlocal.sh file?

Posted by jhsu on Aug. 07 2008,01:52
I'm looking at /usr/share/apsfilter/SETUP .  This is the file that contains the program for setting up apsfilter.

export APS_BASEDIR="/usr/share/apsfilter"
cd "$APS_BASEDIR"
CONF_DIR="/usr/etc/apsfilter"
SPOOL="/var/spool/lpd"

do_main_menue is the main menu function.

Selecting i/I to install means means that [ "$proceed" ] && MENU_DONE=true ;;

This somehow (I don't fully understand) leads to the function do_install_filter.  $QUEUE is the printer name (default "lp").  This function involves the file /etc/printcap , the directory  /usr/etc/apsfilter/lp , the directory /var/spool/lpd , the file /var/spool/lpd/log, the file /var/spool/lpd/acct, and the file apsfilterrc (I think under /var/spool/lpd/).

Posted by jhsu on Aug. 07 2008,03:27
I've gone through the file and symlinks, and the installation process doesn't involve any critical files/directories other than the ones we're supposed to enter in /home/dsl/.filetool.lst .

I checked /home/dsl/.xfiletool.lst , and nothing seems amiss here.  None of those three files are included.

I have noticed that while opt/printcap and opt/apsfilter do save through reboots, var/spool/lpd/lp does not .

So that tells me that the var/spool/lpd/lp directory gets deleted at some point in the powerdown or bootup process.  Can anyone here point me to the files that provide the instructions for these processes?

Posted by jpeters on Aug. 07 2008,08:44
Quote (jhsu @ Aug. 07 2008,03:27)
I have noticed that while opt/printcap and opt/apsfilter do save through reboots, var/spool/lpd/lp does not .

So that tells me that the var/spool/lpd/lp directory gets deleted at some point in the powerdown or bootup process.  Can anyone here point me to the files that provide the instructions for these processes?

The "var" directory is used for files that change while the system is running.
Posted by roberts on Aug. 07 2008,16:15
var/spool/lpd should be in your /opt/.filetool.lst and is a automatic by product of using apsfileter. Unless, of course, you fail to properly shutdown your machine or have modified this process. As during a normal shutdown, if an apsfiler printer setup was attempted you are prompted to save the setting, including var/spool/lpd (see /usr/local/bin/exitcheck.sh)

If your question is now how do I start lpd, then it can be added as a boot time option of lp to your boot time configuration file, be it grub, lilo, syslinux.cfg, etc. Or you can add the fullpath command to /opt/bootlocal.sh.

Posted by jhsu on Aug. 07 2008,17:58
I'm now trying to save the files in /var/spool/lpd to /home/dsl when powering down and then restoring them back to /var/spool/lpd when booting back up again, but that's not working.  

The command during powerdown is:
sudo cp -aprv /var/spool/lpd/* /home/dsl/.spool

The command during powerup is:
sudo cp -aprv /home/dsl/.spool/* /var/spool/lpd

Why doesn't this work?  

So far, here's how I'm doing on this:
1.  I have no difficulty with saving opt/printcap or opt/apsfilter.
2.  I have no difficulty with automating the export command.  I put "export PRINTER=lp" in the /home/dsl/.bashrc file.
3.  I can't figure out how to save /var/spool/lpd/lp .  Because of this, I have to go through the installation mumbo-jumbo every time I reboot.  This is so annoying!
4.  I can't figure out how to automate DSL menu -> System -> Printing/Lpd -> start .  Because of this, I have to go through this every time I reboot.

Posted by roberts on Aug. 07 2008,20:48
I don't think I can help you. You ignore what I post. If you insist on copying system files into /home/dsl as a way to back them up, then no wonder you have issues. You need to learn what the file /opt/.filetool.lst does. Try small exmaples to gain confidence.
Posted by jhsu on Aug. 09 2008,22:27
Quote (roberts @ Aug. 07 2008,16:15)
var/spool/lpd should be in your /opt/.filetool.lst and is a automatic by product of using apsfileter. Unless, of course, you fail to properly shutdown your machine or have modified this process. As during a normal shutdown, if an apsfiler printer setup was attempted you are prompted to save the setting, including var/spool/lpd (see /usr/local/bin/exitcheck.sh)

If your question is now how do I start lpd, then it can be added as a boot time option of lp to your boot time configuration file, be it grub, lilo, syslinux.cfg, etc. Or you can add the fullpath command to /opt/bootlocal.sh.

I have a frugal installation, but I never get the prompt asking me if I want to save my printer setting when I shut down.  Setting up the printer does not cause the /tmp/printer.flag file to appear.

I have found that bootlocal.sh commands are executed by root while the "export PRINTER=lp" command needs to be executed by user dsl.  So that means that the command "su dsl" must be added before "export PRINTER=lp" in the bootlocal.sh file.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.