Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CUPS doesn't restart USB printer automatically
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
astronic
n00b
n00b


Joined: 16 Aug 2003
Posts: 44
Location: Dortmund, Germany

PostPosted: Thu Dec 25, 2003 4:24 pm    Post subject: CUPS doesn't restart USB printer automatically Reply with quote

Dear Gentooists,

I got an HP LaserJet 1300 connected to an USB port working with CUPS. Everything's fine so far but if I turn the printer off and on again, CUPS doesn't automatically restart it (I have to go to the web interface and click on "Start Printer"). However, if I turn on the PC with the printer switched off and switch it on after the system has booted, CUPS recognizes that the printer is there and prints fine.

Hotplug is installed and activated and if I turn the printer off and on again /dev/usb/lp0 reappears after a few seconds, so I think it's a problem of CUPS and not the system.

Any ideas appreciated.

TIA,
Stefan
Back to top
View user's profile Send private message
arwen
n00b
n00b


Joined: 29 Dec 2003
Posts: 47

PostPosted: Mon Dec 29, 2003 1:39 pm    Post subject: Reply with quote

Try this.. (i'm writing this from my memory so beware the errors...)

(write this script to file /etc/hotplug/usb/printer or usblp if you are using kernel 2.6)
Code:
#!/bin/sh
# file: /etc/hotplug/usb/printer

sleep 2
/etc/init.d/cups start

echo "#!/bin/sh" > $REMOVER
echo "/etc/init.d/cups stop" >> $REMOVER
echo "rmmod printer" >> $REMOVER

# for debugging
echo "$REMOVER" > /tmp/.remover_file_name

chmod +x $REMOVER


(give the script execution rights: chmod +x /etc/hotplug/usb/printer)

IN SHORT: When you start your printer kernel loads the printer driver module and hotplug tries to run /etc/hotplug/usb/<kernel module name> script and when you switch off your printer the $REMOVER file is ran. I don't know if this works if you have printer driver compiled in kernel.

If the $REMOVER file is not working, check the /tmp/.remover_file_name file and look the directory exists where is it trying to create the remover file.
_________________
Arwen
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum