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

I want to autostart the software motion with motion -s either at start up of my Ubuntu 12.04 and/or via ssh from a different PC. All this is no problem.

My question is, how do I correctly stop it locally or from remote when the terminal where motion has been started has already been closed? And how to correctly close this terminal once motion -s has been started?

share|improve this question

You should start the command from an instance of byobu. With byobu, you can leave or join the session from the local or remote system to start or stop the process. Also, if you connect via SSH and use byobu to run the command, the command will not be terminated when you disconnect since the byobu session will remain active on the local system.

For more on how to use byobu, check out the community docs here:

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.