[Unit] Description=Run wpe mon for %I # Tie the service lifecycle to the kernel device for the interface BindsTo=sys-subsystem-net-devices-%i.device After=sys-subsystem-net-devices-%i.device [Service] Type=simple WorkingDirectory=/root/wpe ExecStart=/root/wpe/mon -i %I Restart=on-failure RestartSec=5 [Install] # Make the service start whenever the device unit appears WantedBy=sys-subsystem-net-devices-%i.device