Ensure hard drives are not mounted as storage media, add recipe for kanglam
This commit is contained in:
parent
41e5269ae7
commit
0c0e770fca
3 changed files with 209 additions and 1 deletions
11
ansible/templates/99-usb-butter.rules
Normal file
11
ansible/templates/99-usb-butter.rules
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Using udev to mount newly attached usb drives doesn't work.
|
||||
# https://unix.stackexchange.com/a/507150/223286
|
||||
# So, we depend on udisks to mount the disk. *Then* we want to
|
||||
# to setup the symlink and lighttpd config with our script.
|
||||
# We can run the script immediately because it waits for the disk
|
||||
# to be mounted.
|
||||
|
||||
# Mount newly inserted drives, creating the directory if it doesn't exist
|
||||
ACTION=="add", KERNEL=="sd[a-z][1-9]", ENV{ID_BUS}=="usb", TAG+="systemd", ENV{SYSTEMD_WANTS}+="udisks2-mount@%k.service", ENV{SYSTEMD_WANTS}+="serve-usb@%k.service"
|
||||
|
||||
# When the disk is `unmounted, the symlink will just point to a now-empty directory.
|
||||
Loading…
Add table
Add a link
Reference in a new issue