udev and jpilot-sync
Derek Broughton
news at pointerstop.ca
Mon Jan 21 15:10:02 UTC 2008
Bill Moseley wrote:
> On Sun, Jan 20, 2008 at 12:07:34PM -0800, Bill Moseley wrote:
>> I tried adding the udev rule above and appending:
>>
>> RUN+="su - moseley -c jpilot-sync"
>
> Well, I found the rule that creates /dev/pilot and added a new rule:
>
>
> KERNEL=="ttyUSB*", \
> ATTRS{product}=="Palm Handheld*|Handspring *|palmOne Handheld", \
> RUN+="/bin/su - moseley -c 'sleep 2; jpilot-sync'"
>
> That syncs, but I don't think it's correct.
>
> For one thing I seem to need the sleep to make it work, and it also
> seems to match twice (and thus run the program twice):
I doubt there's a way to avoid the sleep - it takes the pilot a while to
make the connection. As for the double bounce, I used to have a similar
rule that only matched either even or odd ttyUSB numbers (I can't remember
which). The pilot actually _does_ connect twice, on ttyUSB0 and ttyUSB1
(or higher numbers if you've connected before, or have another serial USB
device), so one of those is the data connection and one is some sort of
control connection. Since the RUN command doesn't actually care which one
is the data connection, it's probably easiest to match something like:
KERNEL=="ttyUSB*[02468]"
I'm not sure that's the correct syntax, but you seem to understand what
you're doing so I leave it up to you :-)
--
derek
More information about the ubuntu-users
mailing list