Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As of now, I am using the following commands to start, kill, restart my application on ubuntu.

ps -ef | grep memcached

ps -ef | grep java

kill -9 "pid of memcached and java"

sudo nohup java -classpath mCruiseOnServer_lib/ -jar mCruiseOnServer.jar 2>&1 > mcruiseonL.log &

/usr/bin/memcached -m 128 -vvv -p 11211 -U 11211 -u ubuntu -d > memcached.log 2>&1 &

Is there a easier way to do this ?

share|improve this question
up vote 1 down vote accepted

If you installed memcached from the software center or the standard repositories (which is highly recommended!), you can restart it using:

service memcached restart

If your java server provides an upstart script, then you should be able to use a similar command for that. If not, you could potentially write an upstart script for it to automate your commands.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.