Memcache and NGINX – strart and stop services – cheat sheet

Saturday, 3. December 2011

start nginx:

sudo /usr/local/nserver/nginx/sbin/nginx

stop nginx:

sudo kill -HUP $( cat /usr/local/nserver/nginx/nginx.pid )
sudo kill -QUIT $( cat /usr/local/nserver/nginx/nginx.pid )

The master process can handle the following signals:

TERM, INT– Quick shutdown
QUIT– Graceful shutdown
KILL– Halts a stubborn process
HUP– Configuration reload. Start the new worker processes with a new configuration. Gracefully shutdown the old worker processes
USR1– Reopen the log files
USR2– Upgrade Executable on the fly
WINCH– Gracefully shutdown the worker processes

There’s no need to control the worker processes yourself. However, they support some signals, too:

TERM, INT– Quick shutdown
QUIT– Graceful shutdown
USR1– Reopen the log files

Start Memcache:

/usr/local/nserver/memcached/bin/memcached -d -uroot -m512 -p11211 start

Start Memcache:

/usr/local/nserver/memcached/bin/memcached -d -uroot -m512 -p11211 stop

NOTE:
You way want to try: sudo locate ‘memcache’ OR ‘nginx.pid’ in order to locate your paths.