lpadmin/cups problem

Lou Ruppert himself at louruppert.com
Wed Jan 31 15:46:10 CET 2007


Per Foreby a écrit :
> I'm trying to setup printers during the installation, using "$ROOTCMD
> lpadmin ...".
>
> What I do now is to create /INSTALL.NEW at the end of the
> installation, and make that file trigger "fai softupdate" at the first
> boot, but it would of course be nice to avoid that extra stage. 

I found the same problem.  What I've been doing is creating an init
script to run on the first reboot of the machine, which then finishes
the job when CUPS is running.  The script then deletes itself when it's
finished.  Here's an example install script from FAI:

#!/bin/sh
#
# We copy an init script to do the dirty work on reboot, so that we have
CUPS
# running properly, and so on.  It's a dirty hack, but it works.
fcopy /etc/rc2.d/S20installprinter

And the script in question:
#!/bin/sh
/usr/sbin/lpadmin -E -plab -D"HP Laser Printer" -vparallel:/dev/lp0
-P/usr/share/ppd/hpijs/HP/HP-LaserJet_4V-hpijs.ppd
/usr/bin/cupsenable lab
/usr/sbin/lpadmin -d lab
rm /etc/rc2.d/S20installprinter

Same strategy works for other things which require a running system to
pull off.

-Lou





More information about the linux-fai mailing list