<div dir="ltr"><br>Hello Martin,<br><br><span style="background-color:rgb(0,255,0)"><span style="background-color:rgb(0,255,0)"><span style></span></span><span style="background-color:rgb(238,238,238)"><span style></span><span style="color:rgb(153,0,255)">RM<br>>> So far I found that udisk listens to udev events. Once udev notifies<br>>> udisks that a disk is plugged in, udisk takes over and does the<br>>> mounting by calling ntfs-3g.</span></span></span><span style="color:rgb(153,0,255)"><span style="background-color:rgb(238,238,238)"><span style></span></span></span><br><br><span style="color:rgb(255,0,255)">Martin<br>>> Not quiet. udisks itself does not have "policy" for automounting, it<br>>> only provides the D-Bus notifications and D-Bus interfaces for<br>>> mounting. The actual automounting is done by the desktop; for GNOME<br>>> that is gvfs or nautilus (it changed several times in the past), other<br>>> desktops like KDE have a similar mechanism: They listen to udisks's<br>>> D-Bus signals and ask UDisks to mount (or not; that depends on the<br>>> user configuration).<br></span><br>RM<br>You are saying that nautilus will listen to D-Bus messages and then call udisks to do that actual mounting.<br>I am saying this because when you try the following experiment, the messages that are printed on syslog<br>are the same:<br><br>Steps of follow:<br>1. Disconnect the ntfs usb drive.<br>2. Run the command in the terminal: tail -f /var/log/syslog<br>3. Connect the ntfs usb drive.<br>4. Observe the messages printed in the terminal of Step 2.<br>5. Open another terminal window and run the command: udisksctl unmount -b <name of usb drive><br>6. Now in the terminal opened in Step 5, run the command udisksctl mount -b <name of usb drive><br>7. The last few messages printed in the terminal opened for Step 2, when Step 3 was performed are the same as those when Step 6 was performed.<br><span style="color:rgb(255,0,255)"><br>RM<br>>> I just want to know where in the udisk source code does udisk listen<br>>> to udev events?<br><br>Martin<br>>> The gudev library translates uevent netlink socket events into a<br>>> GObject "uevent" signal. In src/udiskslinuxprovider.c.<br>>> udisks_linux_provider_init() connects that uevent signal to<br>>> on_uevent(), which is also defined in that file.</span><br><br><br>Lets us say, I write a udev rule that performs a specific action when the usb disk drive is mounted. Will Udisks still listen to the this particular event and pass it on to D-Bus and then nautilus will run it predefined action and try to mount the disk.<br><br>Regards,<br>RM<br><br><br></div>