I am developing a device that runs Raspbian on Raspberry Pi. The device runs a background process that should be able to access usb drives when they are plugged in. The problem is that the background process is owned by another user, say user1, while the mountpoint /media/pi/KINGSTON, for example, is owned by 'pi'. This results in EACCESS error for the background process.
It is not possible to use mount commands etc., as the end user will only have access to a simple UI. Is it possible to always automatically mount the device so that the mountpoint is owned by user1, e.g., /media/user1/KINGSTON even if user pi is logged in? Only user1 will need access to the drive