memcached restart starts a new memcached and doesn't kill the old one
I'm running my rails app in production mode and in staging mode on the same server, in different folders.  They both use memcache-client which requires memcached to be running.

As yet i haven't set up a deploy script and so just do a deploy manually by sshing onto the server, going to the appropriate directory, updating the code, restarting memcached and then restarting unicorn (the processes which actually run the rails app).  I restart memcached thus:

    sudo /etc/init.d/memcached restart &

This starts a new memcached, but it doesn't kill the old one:  check it out:

    ip-<an-ip>:test.millionaire[subjects]$ ps afx | grep memcache
    11176 pts/2    S+     0:00  |           \_ grep --color=auto memcache
    10939 pts/3    R      8:13              \_ sudo /etc/init.d/memcached restart
     7453 ?        Sl     0:00 /usr/bin/memcached -m 64 -p 11211 -u nobody -l 127.0.0.1

    ip-<an-ip>:test.millionaire[subjects]$ sudo /etc/init.d/memcached restart &
    [1] 11187

    ip-<an-ip>:test.millionaire[subjects]$ ps afx | grep memcache
    11187 pts/2    T      0:00  |           \_ sudo /etc/init.d/memcached restart
    11199 pts/2    S+     0:00  |           \_ grep --color=auto memcache
    10939 pts/3    R      8:36              \_ sudo /etc/init.d/memcached restart
     7453 ?        Sl     0:00 /usr/bin/memcached -m 64 -p 11211 -u nobody -l 127.0.0.1
    
    [1]+  Stopped                 sudo /etc/init.d/memcached restart
    ip-<an-ip>:test.millionaire[subjects]$ sudo /etc/init.d/memcached restart &
    [2] 11208
    ip-<an-ip>:test.millionaire[subjects]$ ps afx | grep memcache
    11187 pts/2    T      0:00  |           \_ sudo /etc/init.d/memcached restart
    11208 pts/2    R      0:01  |           \_ sudo /etc/init.d/memcached restart
    11218 pts/2    S+     0:00  |           \_ grep --color=auto memcache
    10939 pts/3    R      8:42              \_ sudo /etc/init.d/memcached restart
     7453 ?        Sl     0:00 /usr/bin/memcached -m 64 -p 11211 -u nobody -l 127.0.0.1

What might be causing it is there's another memcached running - see the bottom line.  I'm mystified as to where this is from and my instinct is to kill it but i thought i'dd better check with someone who actually knows more about memcached than i do.

Grateful for any advice - max
memcached restart starts a new memcached and doesn't kill the old one
===

I'm running my rails app in production mode and in staging mode on the same server, in different folders.  They both use memcache-client which requires memcached to be running.

As yet i haven't set up a deploy script and so just do a deploy manually by sshing onto the server, going to the appropriate directory, updating the code, restarting memcached and then restarting unicorn (the processes which actually run the rails app).  I restart memcached thus:

    sudo /etc/init.d/memcached restart &

This starts a new memcached, but it doesn't kill the old one:  check it out:

    ip-<an-ip>:test.millionaire[subjects]$ ps afx | grep memcache
    11176 pts/2    S+     0:00  |           \_ grep --color=auto memcache
    10939 pts/3    R      8:13              \_ sudo /etc/init.d/memcached restart
     7453 ?        Sl     0:00 /usr/bin/memcached -m 64 -p 11211 -u nobody -l 127.0.0.1

    ip-<an-ip>:test.millionaire[subjects]$ sudo /etc/init.d/memcached restart &
    [1] 11187

    ip-<an-ip>:test.millionaire[subjects]$ ps afx | grep memcache
    11187 pts/2    T      0:00  |           \_ sudo /etc/init.d/memcached restart
    11199 pts/2    S+     0:00  |           \_ grep --color=auto memcache
    10939 pts/3    R      8:36              \_ sudo /etc/init.d/memcached restart
     7453 ?        Sl     0:00 /usr/bin/memcached -m 64 -p 11211 -u nobody -l 127.0.0.1
    
    [1]+  Stopped                 sudo /etc/init.d/memcached restart
    ip-<an-ip>:test.millionaire[subjects]$ sudo /etc/init.d/memcached restart &
    [2] 11208
    ip-<an-ip>:test.millionaire[subjects]$ ps afx | grep memcache
    11187 pts/2    T      0:00  |           \_ sudo /etc/init.d/memcached restart
    11208 pts/2    R      0:01  |           \_ sudo /etc/init.d/memcached restart
    11218 pts/2    S+     0:00  |           \_ grep --color=auto memcache
    10939 pts/3    R      8:42              \_ sudo /etc/init.d/memcached restart
     7453 ?        Sl     0:00 /usr/bin/memcached -m 64 -p 11211 -u nobody -l 127.0.0.1

What might be causing it is there's another memcached running - see the bottom line.  I'm mystified as to where this is from and my instinct is to kill it but i thought i'dd better check with someone who actually knows more about memcached than i do.

Grateful for any advice - max