Reputation: 43
I'm trying to find a way to attach a running process to a new terminal window so I can interact with it and manipulate it using the terminal. Reptyr is a tool for Linux that appears to do exactly what I want to do, but is there any solution for Mac?
For context: I run a Minecraft server and have it auto start with cron. This has the server run in the background, not attached to any terminal.
Is there any way to do what I'm asking on Mac? Thanks!
Upvotes: 3
Views: 2853
Reputation: 27333
You can instead start a screen session with cron and later attach to it:
@reboot /usr/bin/screen -dmS minecraft /path/to/java /path/to/minecraft.jar etc..
Later, you can screen -R minecraft
to get to the server console, and Ctrl+A, D
to detach again.
Upvotes: 2