Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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