Hi all,
I am battling with my unicorn deploy scripts at the moment. First it
was the "sleep" thing after sending a SIGUSR2 which I read about on
the mailing list just now so it seems I''m not the only one there. The
default of "2" was rarely working for me, upping that to 5 helps out
but still not ideal as it still fails occasionally, e.g. you might
sleep for the perfect amount of time to the point where the
unicorn.pid file disappears for a very short period of time.
Anyway, my main issue is that I am keeping 5 deploys, capistrano style
where it symlinks the current deploy as "current". I have made sure my
unicorn init scripts and configs all only use this "current" path,
nothing refers directly to the timestamped path invented by the deploy
system (chef in my case).
Yet, I am see that when I send SIGUSR2 to the unicorn master, the
following ends up in the log:
I, [2012-08-07T06:54:34.716138 #26569] INFO -- : executing
["/home/my_user/my_app/releases/20120807030020/gems/ruby/1.9.1/bin/unicorn_rails",
"-D", "-E", "production", "-c",
"/home/my_user/my_app/current/config/unicorn.rb",
{7=>#<Kgio::TCPServer:fd 7>}] (in
/home/my_user/my_app/releases/20120807065124)
I presume here the first path is the current running unicorn and the
second path is the supposed working directory. Neither of these are
correct, since it has gone and followed the "current" symlink when
executing that unicorn the first time, as well as when resolving the
working directory that second time. (Since you will notice they are 2
different releases). The first incorrect path is from when I first did
an initial start of the unicorn_rails command.
I say "incorrect path", those paths do in fact exist, for now. The
issue is when that first release that I used to "start" the unicorn
process becomes older than the 5th release and is deleted from disk.
Then the SIGUSR2 will fail saying it can''t find that path to restart
the app. I then need to jump in and send a QUIT manually and start it
again.
I''m sure heaps of people must be doing this, so clearly I''m
doing
something wrong, I just can''t figure out what it is. As mentioned,
I''ve triple checked and I am not referencing the
"20120807030020" path
anywhere, according to grep anyway. My config/init script most
definitely just reference /home/my_user/my_app/current.
Furthmore, this one just weirds me out, the "gems" path is also a
symlink, to /home/my_user/my_app/shared/gems, so why would unicorn be
following the symlink on /home/my_user/my_app/current but not on
/home/my_user/my_app/current/gems?
I''m not subscribed to this mailing list, so if you could CC me in
response that would be super. Although I will be checking the archives
anyway to make sure I don''t miss a possible solution.
regards,
Danial