Re: lpadmin/cups problem

2007-01-31 Thread Achim Bohnet
On Wednesday, 31. January 2007, Per Foreby wrote:
 I'm trying to setup printers during the installation, using 
 $ROOTCMD lpadmin 
 
 However, since the is no cupsd in the installation environment, lpadmin 
 doesn't have anyone to talk to, and the error message in shell.log is:
 
lpadmin: Unable to connect to server: Connection refused
 
 I thougt about adding cupsys to the nfs environment, but cupsd 
 wouldn't create the configuration in the rigth place.
 
 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.
 
 Has anyone had this problem and solved it? Would it for exampel work if 
 I started cupds at the end of the installation ($ROOTCMD
 /etc/init.d/cupsys start) Any other suggestions?

For my printer server I made a tar of /etc/cups that get's
reinstalled.  All others nodes just listen what the cups
server announces.  No need to do anything for them.

If you had to add a local printer, I would setup it like:
install the /etc/cups/ppd/my-printer.ppd  And the section
printer my-printer ... /printer from /etc/cups/printers.conf.
During install cat my-printer.conf  /etc/cups/printers.conf

I.e. no need to use lpadmin and have cupsd running ;)

Achim
 
 /Per
 
 



-- 
  To me vi is Zen.  To use vi is to practice zen. Every command is
  a koan. Profound to the user, unintelligible to the uninitiated.
  You discover truth everytime you use it.
  -- [EMAIL PROTECTED]


Re: ssh key / fai-chboot options?

2007-01-31 Thread Thomas Lange
 On Wed, 31 Jan 2007 15:25:57 +0100, Adrian von Bidder [EMAIL PROTECTED] 
 said:

  * to use the initrd trick for all hosts, does fai-chboot has an easy 
option 
 so I don't have to modify the pxelinux.cfg file manually each time?  (I 
 don't want to create a default file - I don't want mistakes to happen 
when 
 somebody randomly net-boots some machine!)
Currently fai-chboot does not has options for adding initrd
information. But you can create a template manually, and then use the
copy option -c. See man fai-chboot for more details.

-- 
regards Thomas


Re: lpadmin/cups problem

2007-01-31 Thread Lou Ruppert
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 -DHP 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





Logfiles

2007-01-31 Thread Adrian von Bidder
Yo!

Another small issue: while the installation copies back the log files just 
fine, softupdates don't.

FAI_LOGPROTO=ssh and LOGUSER=fai are set.

I don't even find something in the log, fai.log ends like:

+++
The softupdate took 26 seconds.
Source hook: savelog.LAST.source
ERRORS found in log files. See /var/log/fai/current/error.log.
savelog.LAST.source  OK.
Calling task_savelog
+++

(error.log is not useful either; there are some errors because my package 
list is not entirely up to date yet.)

cheers
-- vbi

(this is fai-client 3.1.6 on current etch)

-- 
Enter any 11-digit prime number to continue...


pgp0XgQ6kWpxJ.pgp
Description: PGP signature


Re: Logfiles

2007-01-31 Thread Thomas Lange
 On Wed, 31 Jan 2007 15:55:33 +0100, Adrian von Bidder [EMAIL PROTECTED] 
 said:

 FAI_LOGPROTO=ssh and LOGUSER=fai are set.
Also LOGSERVER or SERVER must be set. Otherwise the remote copying of
the log files will not be executed.

-- 
regards Thomas


Re: lpadmin/cups problem

2007-01-31 Thread Per Foreby

On Wed, 31 Jan 2007, Lou Ruppert wrote:


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 -DHP 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.


Thanks, as you say, on less reboot. I try to use the same config for 
install and softupdate, but you solutions could easily be tweaked into 
running the script immediately on a softupdate:


  fcopy /etc/rc2.d/S20installprinter
  if [ $FAI_ACTION == softupdate ]; then
/etc/rc2.d/S20installprinter
  fi

To those who suggested fcopy/ftar: I try to avoid that approach for 
configuration files. The reason is maintainability. With fcopy most of 
the files need to be replaced when upgrading to a new debian version. 
However, using cfengine, debconf and configuration utilies like lpadmin, 
most of the local changes survive the upgrade. And I do of course have 
the same possibility to take advantage of the class hieracy in shell 
scripts (ifclass CLASS) and cfengine scripts (CLASS::).


Cups is an excellent example: The upgrade from sarge to etch (cups 
1.1.23 to 1.2.7) is a major cups upgrade, and the config files are 
probably not portable, but the lpadmin approach is.


/Per