Fixing rtorrent: Could not lock session directory

By | June 11, 2009

rTorrent is a very cool torrent client used in *nix based systems. I have been using it on my Apple TV now for a few weeks with very good results.

Recently the weather here in St. Louis has been stormy and it knocked out my electricity. When the power came back on, I couldn’t get rTorrent started and I was getting this error:

rtorrent: Could not lock session directory: “/Users/frontrow/.rtorrent_session/”, held by “appletv:+189”.

The fix was pretty easy, I went into the .rtorrent_session directory and removed the rtorrent.lock file.

cd ~/.rtorrent_session/
rm -f rtorrent.lock

That was all there was to it, once I removed the lock file I was able to start rTorrent.

26 thoughts on “Fixing rtorrent: Could not lock session directory

  1. Kartun

    Tnx mate, saved me couple of mins on research 🙂

  2. FullProof

    I read a bunch of complicated solutions before getting to this one. First to actually work, and it did so perfectly!

  3. Miguel

    Thanks! I wonder if there’s a way to detect and delete “stale” lock files in this case.

  4. BobbyBooey

    Thanks!! And now I know where all the cool command line kids hang out!! 😉

  5. joe

    run this command at startup
    rm “/home/jb/Downloads/torrent/.session/*.lock”

    or (to load rtorrent as well) run this command at startup
    rm “/home/jb/Downloads/torrent/.session/*.lock” ;rtorrent

    or (to load rtorrent in background) run this command at startup
    rm “/home/jb/Downloads/torrent/.session/*.lock” ;screen -d -m -S rtorrent rtorrent

  6. Ryukia

    After removing the .lock file I still couldn’t start rtorrent and got the different message “couldn’t lock directory .session”. Turned out I couldn’t start rtorrent while I was still in the .session directory. After switching to ~home I could start rtorrent normaly.

  7. Keith Slater Post author

    Yep, I ran into this exact issue a few weeks ago and referred back to here to remember what I did to fix it.

Leave a Reply

Your email address will not be published. Required fields are marked *