What VPN are you using?
In OpenVPN, you can run a script on establishment of a tunnel and another when the tunnel closes. in the UP script, start rtorrent and in the DOWN script you could then terminate the rtorrent process.
I don't know enough about IPSEC and other VPNs to know if this is possible using them.
Bookmarks