Since we are using DevStack in this book, screen becomes a core concept of running DevStack. In this section, we will take a look at some screen commands and how we will be using them in order to interact with DevStack.
Screen is software that essentially is a window manager in Linux. It helps the user to use multiple shell windows from a single SSH session. This is recommended to be used when we have a long running command that needs to survive network disruptions.
Screen is normally used to run long running processes. DevStack creates and runs its entire services in its own screen and if you were to use the ~/devstack/restack.sh
script, it would connect you to the already running screen session.
We installed screen as a prerequisite earlier in the chapter; let us now look at some of the commands that will help us.
Pressing Ctrl + A activates the control mode and any key you press after that is passed as a control key and not as a key press sent to the shell.
In order to use this, you have to press Ctrl + A, release, and press the key that you want to send as a command.
For example, for help, you would press Ctrl + A, release it, and then press the ? key.
Some of the useful commands in screen are as follows:
screen <screen name>
: To create a new screen sessionscreen –ls
: To list all the screen sessionsscreen –r <screen name>
: To reconnect to a screen screen –X –S <screen name> <command>
: To pass a command to the screenOnce inside the screen, the following commands can come in handy:
Since DevStack runs in the screen called stack, we will be able to use all of the commands in order to manage the DevStack system. The screen windows keep debug logs of all the different services.
We should be able to find the screen name using the screen –ls
command. The DevStack default screen name is Stack.
We could connect to it using the command screen –r 20276.stack
(the name shown in the previous command output).
We can then see all the different services at a glance by using Ctrl + A and then ".
We could switch to the window running a particular service by using the up and down arrows and hitting enter.
We could kill the stack by using the command:
screen –X –S 20276.stack quit
That sends the quit
command to the screen thereby killing all the services.
DevStack installs the services and opens a screen for the services. Since the startup scripts are not installed (like in the case of the production install), in order to restart the services, we will need to use the following procedure:
screen –r 20276.stack
We could copy this command line and create our own startup scripts should we choose not to use this method.
The service has now been restarted and we can continue to work on the server. We can use the other features of the screen with DevStack.