Automatic printer startup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
hotplug (Ubuntu) |
Invalid
|
Wishlist
|
Scott James Remnant (Canonical) |
Bug Description
The report isn't a hotplug bug but a proposition related to hotplug
I explain the situation :
I have many desktop Linux installed for friends or family.
A very reccurent problem is the following :
An inkjet printer is installed on the computeur but the user forgot to powered it on. The user launch a print. Cups see that the printer don't answer so it disable it. The user realize that he should powered on his printer, do it but nothing is printed because the printer is disabled by Cups. The user must go to cups (via web/kcontrol/
The solution I council his following : enable printer by hotplug when it is powered on.
I join the script I've done for my kubuntu box. It's a very dirty hack but it's better than nothing.
hola, I'm not used to this system. ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ---- ******* ******* ******* ******* ******* ******* ******* ******* ******* ****** ******* ******* ******* ******* ******* ******* ******* ******* ******* ******
Here is the c/p of the script :
(hope line breaks won't be to awful)
-------
#!/bin/bash
#******
# Copyright (C) 2006 by Olivier Oriol *
# <email address hidden> *
# *
# This program is free software; you can redistribute it and/or modify *
# it under the terms of the GNU General Public License as published by *
# the Free Software Foundation; either version 2 of the License, or *
# (at your option) any later version. *
# *
# This program is distributed in the hope that it will be useful, *
# but WITHOUT ANY WARRANTY; without even the implied warranty of *
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# GNU General Public License for more details. *
# *
# You should have received a copy of the GNU General Public License *
# along with this program; if not, write to the *
# Free Software Foundation, Inc., *
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. *
#******
#****** ******* ******* ******* ******* ******* ******* ******* ******* ******* ****** usb/printer ******* ******* ******* ******* ******* ******* ******* ******* ******* *****
# /etc/hotplug/
#
# Purpose of this script : if you send job to a printer when the printer isn't alive
# cups disable the printer and you need to re-enable it by hand
# after powered on your printer.
# this is very annoying (and quite ununsterdandable) for basic users
# The script aims to be launch at hotplug printer detection and
# enable all present printers
#
# Disclaimer : This script is an _very_ dirty hack. It enable _all_ printers each time a printer is
# powered on (or plugged in). It also try to start cupsd if it stopped for any reasons
# And last but not least, it display a message if there is an user connected to a KDE
# The script was writed under Kubuntu breezy (5.10). I try to make it distro-free but
# it hasn't be tested elsewhere.
# Oh, and there is also many sleep in the soup
# Now, You're warned ;)
#
# *******
if [ "${ACTION}" = "add" ]
then
#we look if cupsd is up
cupsAwaken=`ps aux | grep cupsd | grep -v grep`
if [ "$cupsAwaken" == "" ]
then
# cupsd isn't here
#we look if it is installed
lsCups=`ls /etc/init.d/cups*` #this is because some distrib use cupsd others cupsys
if [ "$lsCups" != "" ]
then
#ok cups exist so launch it (we wait a little to make sure that all nodes are ok)
(sleep 2 && $lsCups start)
else
errMSG="Le logiciel de gestion des imprimantes n'est pas installé"
fi
fi
sleep 10 # we ...