Sample Header Ad - 728x90

How to execute a script after every systemd automount?

5 votes
1 answer
2488 views
I am trying to setup a system such that a script gets executed everytime any USB storage device is mounted (in this case, automounted by systemd). Based on a few references here , here and here , systemd allows for the execution of custom scripts after a specific device is mounted, but these either: - Need a specific device or mountpoint. - Use udev, which triggers too early, and holds the mounting process. - Use audits or logs, which isn't very satisfying. Is there anyway to be *less* specific in systemd units, allowing for the use of ExecStart after any succesful (auto)mount?
Asked by John WH Smith (16408 rep)
Jul 14, 2017, 02:37 PM
Last activity: May 17, 2025, 04:05 AM