From: tasos <ta...@ya...> - 2006-09-12 12:59:40
|
Thanks for the reply.Actually i don't know if this solution is what i really need.I will see what i can do,although. Waiting some news for the segmentation fault error from michael. --- Ernst Bachmann <e.b...@xe...> wrote: > On Tuesday 12 September 2006 13:43, tasos wrote: > > Hello ernst. > > Until now i'm using this rule in udev in order to > > recognise my devices. > > BUS=="usb",SYSFS{interface}=="Crystalfontz CFA-635 > USB > > LCD", KERNEL=="ttyUSB*", > > SYMLINK+="lcd1/%k",MODE="0666" > > > > I will use more than one devices.So my question > is. > > I will launch lcd4linux -f foo,lcd4linux -f bar > etc. > > Will those processes killed automatically if i use > > udev.i mean when foo which uses ttyUSB6,is > > disconnected will udev recognise the correct > lcd4linux > > process? > > If so can you help me a little bit. > > Well, unfortunatly the name and location of the > PIDFILE written by lcd4linux > is hardcoded, to run multiple instances this needs > to be fixed first (e.g. > make lcd4linux accept a command-line parameter > specifing the pidfile > location) > > Then, for each device in question, write a little > shellscript (forking > lcd4linux, and killing it), add it to your udev > rule: > ...MODE="0666",RUN+="/path/my_lcd_1_script" > ...MODE="0666",RUN+="/path/my_lcd_2_script" for the > second lcd and so on. > > the script would be something like: > --- /path/my_lcd_1_script --- > #!/bin/sh > if [ "$ACTION" = remove ]; then > # Kill running lcd4linux > kill `cat /var/run/lcd4linux_1.pid` > else > # start new lcd4linux process, assert > $ACTION==add > lcd4linux -f /etc/my_lcd_1_config.cfg > --pidfile=/var/run/lcd4linux_1.pid > fi > ----------------------------- > (With more sanity checks added, like checking for > the pidfile, check if the > pid belongs to lcd4linux, etc. maybe use a distro > tool > like "start-stop-deamon" for this, they usually > contain most of those checks > already...) > > have a look at the udev manpage for more info, esp. > how to pass the location > of the devicenode to your script etc. > > > > > BTW is it so difficult to add some code which will > > disconnect it automatically? > > Thank you in advance! > > Well, in that case, it is. The kernel only presents > a virtual comport to > lcd4linux, and lcd4linux only notices its gone when > it tries to use it. > > Devices/Drivers that work directly with usb (libusb) > have it easier here, they > can notice the disconnect, but AFAIK don't shutdown > then. > Some drivers (lcd2usb for example) even try to wait > for an eventual reconnect > of the device, they keep running on purpose. > > > /Ernst > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support > web services, security? > Get stuff done quickly with pre-integrated > technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 > based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Lcd4linux-users mailing list > Lcd...@li... > https://lists.sourceforge.net/lists/listinfo/lcd4linux-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |