0

I have a fedora23 live cd spin created in which I created a udev script

the udev rule states: SUBSYSTEMS=="scsi", KERNEL=="sd[a-z]", GOTO="mount_through_script" # Else GOTO="script_end"

LABEL="mount_through_script"
ACTION=="add", RUN+="/usr/bin/mount_usb.sh %N"
ACTION=="remove", RUN="/usr/bin/rmdir %N"

# Exit
LABEL="script_end"

the mount_usb.sh script does multiple things, like doing some work when a specific USB is inserted, but the most important command executed is:

mount -ouser,umask=0000 \${mount_source} "/media/mountpoint";

where mount_source is the path provided by the ADD action.

until the last line of the script the mounted drive seems fine, auto mounted and scripts executed, but when it exits, the freshly mounted drive is unmounted. When I run the script with the same parameters as root in a console everything works just fine.

Formerly with fedora 19 everything seemed to work, but now we are upgrading to fedora23 and it starts failing.

I can not find any logs stating a reason why it is unmounted and besides the occasional "not correctly unmounted" warning everything looks ok.

Anyone a hint what might be going on

  • I have some more information about this issue. I added some debug information in the script called by udev (running as root). When I print the list of mounts during execution of the script it shows that the drive is mounted. But when I list the mountpoints in a root terminal it does not show them. When I add another USB stick the script logs that both sticks are mounted, but again in the root terminal it says otherwise – Raymond Den Ouden May 25 '16 at 08:57
  • Problem solved, the solution can be found in http://serverfault.com/questions/766506/automount-usb-drives-with-systemd – Raymond Den Ouden Jun 02 '16 at 10:15

0 Answers0