Skip to content

Instantly share code, notes, and snippets.

@vladbabii
Created January 29, 2018 16:54
Show Gist options
  • Save vladbabii/2e76246aab0b5212db2d3759de174ebd to your computer and use it in GitHub Desktop.
Save vladbabii/2e76246aab0b5212db2d3759de174ebd to your computer and use it in GitHub Desktop.
Systemd run script after mount
# original: https://askubuntu.com/questions/25071/how-to-run-a-script-when-a-specific-flash-drive-is-mounted
# you can find your device unit with: sudo systemctl list-units -t mount
# put this into /etc/systemd/system/your.service
[Unit]
Description=SharedMountTrigger
Requires=mnt-shared.mount
After=mnt-shared.mount
[Service]
ExecStart=/usr/local/bin/x-start-docker
[Install]
WantedBy=mnt-shared.mount
# Then you have to start/enable the service:
# sudo systemctl start your.service
# sudo systemctl enable your.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment