From: Thomas Stewart Date: Mon, 02 Oct 2006 16:47:48 +0000 Subject: tty events for usbserial not sent during boot Message-Id: <20061002164748.GA31817@stewarts.org.uk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Hi, I want to run a script each time a usb serial device is connected to my pc. I want this script to run for both 1) usb serial devices that are found during boot and 2) any other usb serial device that is connected after boot up. The script will run minicom inside a screen session (eventually). The problem is I can't get the script to run for devices found during bootup. So I created a new rules file, /etc/udev/rules.d/ttyUSB.rules: ACTION=3D"add" SUBSYSTEM=3D"tty" ENV{PHYSDEVBUS}=3D"usb-serial" RUN+=3D"/et= c/udev/ttyUSB" With a simple /etc/udev/ttyUSB to start with: #!/bin/bash echo "ttyUSB: `date` $ACTION,$SUBSYSTEM,$PHYSDEVBUS,$DEVPATH,$DEVNAME" When I boot with a usb serial device attached, it appears that the above script never runs. If I boot without a usb serial device attached and I wait for the system to get to login and then attach it, then it runs the script as expected. I set /etc/udev/udev.conf:udev_log to info. After booting with the device attached, I examined syslog and found no mention of /etc/udev/ttyUSB at all. There was only 1 entry that had ttyUSB in, which looks like output from the module when its loaded: Oct 2 17:41:07 lilt kernel: usb 2-1.2: MCT U232 converter now attached to ttyUSB0 I rebooted with the device unplugged and waited till I could login. I attached the device and then looked at syslog, which had several mentions of /etc/udev/ttyUSB and ttyUSB0: Oct 2 17:44:37 lilt udevd-event[6337]: udev_rules_get_name: no node name s= et, will use kernel name 'ttyUSB0' Oct 2 17:44:37 lilt udevd-event[6337]: udev_db_get_device: no db file to r= ead /dev/.udev/db/class@tty@ttyUSB0: No such file or directory Oct 2 17:44:37 lilt udevd-event[6337]: udev_node_add: creating device node= '/dev/ttyUSB0', major =3D '188', minor =3D '0', mode =3D '0660', uid =3D '= 0', gid =3D '20' Oct 2 17:44:37 lilt udevd-event[6337]: run_program: '/etc/udev/ttyUSB' Oct 2 17:44:37 lilt udevd-event[6337]: run_program: '/etc/udev/ttyUSB' (st= dout) 'ttyUSB: Mon Oct 2 17:44:37 BST 2006 add,tty,usb-serial,/class/tty/t= tyUSB0,/dev/ttyUSB0' Oct 2 17:44:37 lilt udevd-event[6337]: run_program: '/etc/udev/ttyUSB' ret= urned with status 0 My question is, how to I get the script to run on devices during boot and on devices found afterword? (As a side note, running udevtrigger manually in both situations, the script runs) My test system is a new install of Debian Sid, upgraded to the latest packa= ges on 2/10/06. It's running linux-2.6.17-2-486 and udev-0.100-2. (Can you please cc me as I am not on the list) Regards -- Tom ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=DEVD= EV _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel