Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I know this has been asked before but none of the answers seems to work in OS X Mountain Lion. I would like to launch a process via SSH and close the terminal without killing the process.

nohup ccl64 -e '(ql:quickload :"file")' & 

Doesn't work. When the terminal is closed, the process dies.

nohup ccl64 -e '(ql:quickload :"file")'

Same here.

I think there must be a way. This is very annoying as it works as a standard in any Linux system, yet Mac OS X refuses to work with any of these combinations.

share|improve this question

migrated from serverfault.com Oct 7 '12 at 6:35

This question came from our site for professional system and network administrators.

2 Answers 2

One thing that always works is screen. http://ss64.com/osx/screen.html it seems to be available on Mac OS X per default.

Edit: http://macdevcenter.com/pub/a/mac/2004/07/06/unix_gems.html another tutorial abut screen.

Additionally, here is some quick tips on how to use screen

Open a new 'screen' instance

$ screen

Once, in the screen, you can 'detach' (or close out of it) the screen like this:

ctrl+A and then press D

To resume a screen, you typically do this:

$ screen -x

If you have more than one screen instance, it will tell you their IDs, in which case you can choose which one to resume like this:

$ screen -r <screen id>
share|improve this answer
    
so over ssh I do screen and then pass the nohup command? with or without the & at the end ? –  devnull Oct 7 '12 at 2:57
    
No need for nohup. Just do screen ccl64... & . Later, if you need to you can reconnect with screen -R to monitor progress. Alternatively, just run screen and type the command in there , you can detach with Ctrl+A D. –  chx Oct 7 '12 at 2:58
    
thanks it is possible to save the screen output in a file after the launch ? –  devnull Oct 7 '12 at 3:03
    
Of course, screen can do everything. You want screen -X hardcopy. See bbs.archlinux.org/viewtopic.php?id=47521 for more. –  chx Oct 7 '12 at 6:38

Try screen instead, it should still be part of the default install. Some people even use screen as their default shell so they don't need to worry about nohup at all.

share|improve this answer
2  
could you describe how to run a nohup command with screen? –  devnull Oct 7 '12 at 2:57
    
You use screen instead of nohup, and then detach the screen. Your program will continue to work even if the ssh session ends. –  SvenW Oct 7 '12 at 2:59
    
See man screen for details. –  SvenW Oct 7 '12 at 2:59

Your Answer

 
discard

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