[jp] Problems syncing with udev and jpilot-sync

Adam Richard g4c9z at unb.ca
Tue Jan 18 16:59:03 EST 2005


Here's something else strange.  Doing a test to see whether the device file actually
exists when the script is running, I added this to my script:

ls -l /dev/pilot >> /home/adam/Desktop/pilot.dev_ran.txt

After doing one hotsync press, the file contained:

crw-rw-rw-  1 root uucp 188, 0 Jan 18 17:49 /dev/pilot
crw-rw-rw-  1 root uucp 188, 1 Jan 18 17:49 /dev/pilot
crw-rw-rw-  1 root uucp 188, 0 Jan 18 17:49 /dev/pilot
crw-rw-rw-  1 root uucp 188, 1 Jan 18 17:49 /dev/pilot
crw-rw-rw-  1 root uucp 188, 1 Jan 18 17:49 /dev/pilot

This seems to indicate that it's running multiple times, and at different times the
minor number of the device is different.  I have no clue why udev is doing this.  What
would happen to jpilot-sync if it was run multiple times while already running?

I wrote:

> I am trying to get my handheld to sync with the JPilot data when I press the hotsync
> button, using udev.  Since it's USB, /dev/pilot doesn't appear until the hotsync
> button
> is pressed.  udev is supposed to run the script I installed at
> /etc/dev.d/pilot/pilot.dev whenever the /dev/pilot device appears.  Here's what the
> script looks like (with some comments & whitespace removed):
> 
> #!/bin/sh
> touch /home/adam/Desktop/pilot.dev_ran.txt
> su adam -c jpilot-sync >> /home/adam/Desktop/pilot.dev_ran.txt
> 
> Creating the file is so I know the script ran.  The strange thing is, the file
> appears
> when I push the hotsync button, so the script is running.  Furthermore, when I run
> the
> script manually after the device file has appeared, it synchronizes normally.  But if
> I
> plain push the hotsync button, the handheld just sits there "Connecting to Desktop",
> and eventually times out and gives an error.  The file is created but it is empty,
> so
> apparently jpilot-sync had no output.
> 
> Does anyone see anything I'm doing wrong?  Is there something special about
> jpilot-sync
> that it doesn't work unless its output is going to a terminal or something?
> 
> By the way, the "su" part of the script is because the script is run automatically
> as
> root, but it's the jpilot files in my home directory that need synchronizing.



More information about the Jpilot mailing list