FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 01-20-2008, 08:55 PM
Bill Moseley
 
Default udev and jpilot-sync

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):

1313 ? S< 0:00 /bin/su - moseley -c sleep 2; jpilot-sync
1318 ? S< 0:00 \_ -su -c sleep 2; jpilot-sync
1303 ? S< 0:00 /bin/su - moseley -c sleep 2; jpilot-sync
1304 ? S< 0:00 \_ -su -c sleep 2; jpilot-sync
1321 ? S< 0:00 \_ jpilot-sync

jpilot-sync uses a lock file, so one of them is waiting on the FLOCK
of the other.

Is there a better approach?

--
Bill Moseley
moseley@hank.org


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-21-2008, 02:10 PM
Derek Broughton
 
Default udev and jpilot-sync

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


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-21-2008, 03:19 PM
Bill Moseley
 
Default udev and jpilot-sync

On Mon, Jan 21, 2008 at 11:10:02AM -0400, Derek Broughton wrote:
>
> I doubt there's a way to avoid the sleep - it takes the pilot a while to
> make the connection.

Ok, I wonder why I didn't have to sleep when running the script with
hotplug on my old machine.

>
> 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 :-)

I don't understand it very well, but I suspect it's just
ttyUSB[02468].

What about loading the visor module? Should udev do that
automatically. I just posted a question about this before I saw your
response, but what seems odd to me is the udev rules for loading
modules is in the 90 script which seems backwards -- that you would
want the modules loaded earlier than the other scripts.

In this case, if the visor module is not loaded first then udev
doesn't create the /dev/pilot link (which is in 60-symlinks.rules).

I also don't see where udev *removes* the modules on device removal.



--
Bill Moseley
moseley@hank.org


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 08:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org