Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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.