0

A Rails application is deployed fine via Capistrano (on a gentoo box running Apache front end), a Symlink points to the correct (latest) directory. Only the server keeps using an older directory, restarting Thin does not help. It almost appears as if some caching is going on?

Running the usual Thin server restart for test purposes the next day…

thin restart -s1 -p 3004 -e production

…suddenly DOES indeed use the latest directory. But any new deployment again fails to being used and the scenario starts over again.

# remote directories, via Capistrano
/release…1
/release…2
/release…3 # Server uses this directory, why?
/release…4
/release…5 # symlink 'current' points here

Solved:

I tried to restart Thin from current in the very same shell over and over again. Which embarrassingly means that I stayed in the very same symlinked /current directory to restart. Obviously current in the meantime is actually a new one via Capistrano.

tl;dr

#from current
cd ..
cd current/
Thin restart
David
  • 937
  • 1
  • 12
  • 22

1 Answers1

0

Is your capistrano recipe restarting the server?

DVG
  • 17,392
  • 7
  • 61
  • 88
  • due to problems with exactly that I went with restarting manually. Restarting from the Recipe threw an error `** [out :: revorm.com] sh: thin: command not found`. Probably a path-issue, I assume doing it manually should work? – David May 09 '12 at 11:00
  • It's normally the last thing that happens, so yes, I'd expect so – DVG May 09 '12 at 11:34
  • Restarting manually is doing its job correctly. Yet only like once a day the latest current directory is being used afterwards. The problem persists: It seems as if Rails / the Server is caching the old symlink somewhere, pointing to an older directory until the cache is flushed. How, or better: where to look? – David May 09 '12 at 11:38