Automatic printer startup

Bug #31829 reported by o
6
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/command line/whatever) to re-enable it. This a very non-understandable manipulation for a basic user.

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.

Revision history for this message
o (olivier-oriol) wrote :
Download full text (5.6 KiB)

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. *
#***************************************************************************

#***************************************************************************
# /etc/hotplug/usb/printer
#
# 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 ...

Read more...

Revision history for this message
o (olivier-oriol) wrote :

hum, line breaks are terrible...

Here is a link to the script, it should be better :
http://youp.jexiste.fr/Aldil/Programmation/DemarrageImprimante/printer

Regards,
O

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

We don't use hotplug in dapper.

Instead cups has been modified to listen to HAL events,

Changed in hotplug:
assignee: nobody → keybuk
status: Unconfirmed → Rejected
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.