Created
January 29, 2018 16:54
-
-
Save vladbabii/2e76246aab0b5212db2d3759de174ebd to your computer and use it in GitHub Desktop.
Systemd run script after mount
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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