* tty events for usbserial not sent during boot
@ 2006-10-02 16:47 Thomas Stewart
2006-10-03 9:29 ` Alex Merry
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Stewart @ 2006-10-02 16:47 UTC (permalink / raw)
To: linux-hotplug
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="add" SUBSYSTEM="tty" ENV{PHYSDEVBUS}="usb-serial" RUN+="/etc/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 set, will use kernel name 'ttyUSB0'
Oct 2 17:44:37 lilt udevd-event[6337]: udev_db_get_device: no db file to read /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 = '188', minor = '0', mode = '0660', uid = '0', gid = '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' (stdout) 'ttyUSB: Mon Oct 2 17:44:37 BST 2006 add,tty,usb-serial,/class/tty/ttyUSB0,/dev/ttyUSB0'
Oct 2 17:44:37 lilt udevd-event[6337]: run_program: '/etc/udev/ttyUSB' returned 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 packages
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=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: tty events for usbserial not sent during boot
2006-10-02 16:47 tty events for usbserial not sent during boot Thomas Stewart
@ 2006-10-03 9:29 ` Alex Merry
0 siblings, 0 replies; 2+ messages in thread
From: Alex Merry @ 2006-10-03 9:29 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1.1: Type: text/plain, Size: 723 bytes --]
On Monday 02 October 2006 17:47, Thomas Stewart wrote:
> 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
> packages on 2/10/06. It's running linux-2.6.17-2-486 and
> udev-0.100-2.
If it runs when udevtrigger is run, it sounds like it could be something
to do with the debian startup scripts not triggering events properly.
Do you know how they trigger udev events at bootup?
Alex :-)
--
Pippin
Computer Monkey to the Pelican
www.oxrev.org.uk, www.corpusjcr.org, www.rev.org.uk
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 348 bytes --]
-------------------------------------------------------------------------
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=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #3: Type: text/plain, Size: 226 bytes --]
_______________________________________________
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-10-03 9:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-02 16:47 tty events for usbserial not sent during boot Thomas Stewart
2006-10-03 9:29 ` Alex Merry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).