[Devel-conf] [gmane.linux.hotplug.devel] RUN rules to enable/disable printer queues

Stanislav Ievlev =?iso-8859-1?q?inger_=CE=C1_altlinux=2Eorg?=
Пт Авг 26 15:32:16 MSD 2005


On Fri, Aug 26, 2005 at 12:54:13PM +0400, Anton Farygin wrote:
> Кстати, Стас... а что у нас проиходит при
> подключении/удалении принтера ?
Ну пока ни чего.
Тут надо определиться что мы хотим именно получить:
enable/disable определённого принтера
конфигурирование принтера, если он ещё не был добавлен.

В последнем случае будем пытаться делать полную автоматику или будем вызывать какой интерфейс?

Что касается первого то при отключении устройства от hal насколько я
наблюдал приходит инфомация содержащая какой-то внутренний идентификатор
принтера, соотв. надо где-то генерить и хранить таблицу между этими
идентификаторами и именами очередей в cups.

Товарищ, который писал письмо, многое сделал руками под свой конкретный
случай.

--
Стас.

> 
> Надо бы тоже как-то автоматизировать этот процесс.
> 
> Rgds,
> Rider
> 
> 
> On Thu, 25 Aug 2005 17:43:53 -0700, Zack Weinberg wrote:
> 
> > I have a USB printer which is turned off most of the time.  I want to have
> > the computer automatically run "lpc start" and "lpc stop" on the relevant
> > print queue when the printer is turned on and off, respectively.
> > 
> > I tried to do this with this rule:
> > 
> > BUS=="usb", SYSFS{product}=="Lexmark Optra E310",
> > SYSFS{serial}=="0101137", \
> >     SYMLINK="lp_epson", RUN+="/etc/udev/scripts/lpqueue.sh"
> > 
> > where lpqueue.sh is a little script I wrote that maps ACTION=add to lpc
> > start, and ACTION=remove to lpc stop.
> > 
> > This correctly creates and deletes the lp_epson symlink, but lpqueue.sh is
> > only invoked on add events, not remove events, so it can only do half of
> > its job.  I believe that the rule *does* match on both add and remove,
> > because if it didn't match on remove, it wouldn't know to delete the
> > symlink; so there must be some quirk with RUN= that is not mentioned in
> > the manual...  Any ideas?
> > 
> > I am using udev 068 as packaged by Debian unstable, in conjunction with
> > kernel 2.6.12.5 (prepackaged Debian kernel, linux-image-2.6.12-1-686-smp).
> > 
> > As a side note, it isn't terribly important to me as I only have the one
> > printer, but I have to hardwire the name of the print queue in lpqueue.sh
> > because there isn't enough info passed in its environment to tell one USB
> > printer from another.  If the SYMLINK list were made available to RUN
> > scripts, the script could then do the right thing for an arbitrary number
> > of printers.  (This would be useful to someone who had both a color inkjet
> > and a B/W laser printer attached to the same computer via USB, say.)
> > 
> > zw
> > 
> > 
> > 
> > ------------------------------------------------------- SF.Net email is
> > Sponsored by the Better Software Conference & EXPO September 19-22, 2005 *
> > San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven
> > Development * Managing Projects & Teams * Testing & QA Security * Process
> > Improvement & Measurement * http://www.sqe.com/bsce5sf
> 

> _______________________________________________
> Devel-conf mailing list
> Devel-conf на altlinux.ru
> https://lists.altlinux.ru/mailman/listinfo/devel-conf




Подробная информация о списке рассылки devel-conf