I've found myself thinking about this sometimes. I already keep track of all my online accounts using a password manager. It's kind of morbid to think about, but it wouldn't be too hard to add notes on each account about who to let know if I were to die, then keep the master password with a will (or in a safety deposit box only to be opened under those circumstances).