[Voyage-linux] udev & hotplug
maciek
(spam-protected)
Thu Feb 2 23:20:17 HKT 2012
> >>>> SUBSYSTEM=="video4linux", ATTR{name}=="UVC Camera (046d:080f)",
> >>>> NAME="logitech", GROUP="video", MODE="0660", GOTO="fswebcam_start"
> >>>>
> >>>> GOTO="fswebcam_end"
> >>>>
> >>>> LABEL="fswebcam_start"
> >>>>
> >>>> ACTION=="add", RUN+="fswebcam -c /root/fswebcam.conf
> >>>> --pid=/var/run/fspid"
> >>>>
> >>>> ACTION=="remove" RUN+="/root/script.sh"
> >>>>
> >>>> GOTO="fswebcam_end"
> >>>>
script.sh (+x chmod)
#!/bin/sh
/usr/bin/pkill -f "/usr/bin/fswebcam -c /root/fswebcam.conf"
If I set /usr/bin/pkill -f "/usr/bin/fswebcam -c > /root/fswebcam.conf" from comand line process is killed
action add is ok, but remove -> nothing happen, so I think udev doesn`t make script on remove (plug off) action
On Wed, 1 Feb 2012 15:39:59 +0100, Jordi Soucheiron wrote
> Send the whole rules file please (the sintax is a bit tricky).
> Have you rebooted the devide or reloaded the udev rules?
> Jordi Soucheiron
> Software Engineer
> jsoucheiron at dexmatech.com
>
> DEXMA
> c/ Marie Curie, 8-14
> ES-08042, Barcelona
> t: (+34) 93 181 01 96
> www.dexmatech.com
> Follow us on Twitter and Linkedin
> Síguenos en Twitter y Linkedin
>
> 2012/2/1 maciek <maciek2 at protetyka.lodz.pl>
> I`ve set action remove /usr/bin/pkill -f "/usr/bin/fswebcam -c
> /root/fswebcam.conf"
>
> but on action remove nothing happen....
>
> > >>>> Hello
> > >>>>
> > >>>> I`d like to set my usb webcam as hotplug device. When I plugin I`d like to
> > >>>> start fswebcam deamon and unplug - stop.
> > >>>>
> > >>>> I set it like this:
> > >>>>
> > >>>> SUBSYSTEM=="video4linux", ATTR{name}=="UVC Camera (046d:080f)",
> > >>>> NAME="logitech", GROUP="video", MODE="0660", GOTO="fswebcam_start"
> > >>>>
> > >>>> GOTO="fswebcam_end"
> > >>>>
> > >>>> LABEL="fswebcam_start"
> > >>>>
> > >>>> ACTION=="add", RUN+="fswebcam -c /root/fswebcam.conf
> > >>>> --pid=/var/run/fspid"
> > >>>>
> > >>>> ACTION=="remove" RUN+="???????????"
> > >>>>
> > >>>> GOTO="fswebcam_end"
> > >>>>
> > >>>>
> > >>>> Questions:
> > >>>>
> > >>>> 1. Are those script ok? (action add & remove)
> > >>>> 2. How to kill process fspid (ACTION=="remove")?
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>> v o i p t e l e . n e t , dzwon najtaniej jak to mozliwe
> > >>>> e r a u r . c o m , rozwiazania internetowe dla firm i klientow
> indywidualnych
> > >>>>
> > >>>> _______________________________________________
> > >>>> Voyage-linux mailing list
> > >>>> Voyage-linux at list.voyage.hk
> > >>>> http://list.voyage.hk/mailman/listinfo/voyage-linux
> > >>
> > >> _______________________________________________
> > >> Voyage-linux mailing list
> > >> Voyage-linux at list.voyage.hk
> > >> http://list.voyage.hk/mailman/listinfo/voyage-linux
> > >
>
> _______________________________________________
> Voyage-linux mailing list
> Voyage-linux at list.voyage.hk
> http://list.voyage.hk/mailman/listinfo/voyage-linux
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.voyage.hk/pipermail/voyage-linux/attachments/20120202/2e71fbc6/attachment.html>
More information about the Voyage-linux
mailing list