Operating Systems Concepts & Design
Make sure to return to the AWS Learner Lab page (link in Pilot if you forgot to bookmark it) and hit “Start Lab” to turn on your sandbox / AWS instance.
Use ssh to connect to your AWS Ubuntu instance.
Go to the folder that contains your repository (likely named ceg2350-yourgithubusername).
Create a new directory, Lab09.
Create a file named README.md in the Lab09 folder. The Lab 09 Template can be copied from this link:
https://raw.githubusercontent.com/pattonsgirl/CEG2350/refs/heads/main/docs/Labs/Lab09/LabTemplate.mdYou may refer to additional resources outside of the recommended resources provided.
Any resource that you use that contributes to your understanding of exercises in this lab should be cited in the Citations section of your lab answers. To add citations, provide the site and a summary of what it assisted you with. If generative AI was used, include which generative AI system was used and what prompt(s) you fed it.
If you make mistakes with commands in the lab, note them! Writing down what went wrong and what the correction was will significantly help your learning journey. If you cannot find a correction, it will help the TAs or myself understand what point you reached and determine some potential solutions.
If you cannot ssh to your instance anymore, you may have run into one of these scenarios:
xvda - this would erase your root / / filesystem./etc/fstab - if the system cannot mount the disk, the boot process will hang and not completeIf you think one of those scenarios happened to you, you’ll need to go back to AWS Academy Setup and create a new stack. Once you are in the new instance, don’t forget the steps to cloning your GitHub repo:
sshapt, which, whereisChoose a command line game from this site: It’s Foss - Top 10 Command Line Games for Linux
bastet is what this lab was tested onIn the answer template, document the game name, how you installed it, where the executable is located, and how to run the game.
For the remainder of this lab, you will be running this game to practice controlling processes.
Create a second ssh session to your AWS instance. You should now have two ssh sessions to your AWS instance. This will be referred to as Shell A and Shell B in the exercises below - you decide which is A and which is B.
pstree, ps, kill, pgrep, top / htop| Action | Command or Keybind |
|---|---|
| Check process CPU/memory usage | |
| Show running processes | |
| Show detailed process tree | |
| Find a process by name | |
| Kill a process by PID | |
| Force kill a process by PID | |
| Pause / suspend a process by PID | |
| Resume a suspended process by PID |
ps fields:ps field |
Meaning |
|---|---|
| PID | |
| PPID | |
| UID / USER | |
| TTY | |
| STAT | |
| COMMAND / CMD | |
| %CPU | |
| %MEM | |
| PSR |
ps command for processes owned by your user that will show the fields: USER / UID, PID, PPID, TTY, STAT, and COMMAND / CMDps command.
Provide answers to the following, using Shell B to observe the process statuses:kill to kill only the game.
kill to kill the game and it’s parent process.
ssh session - Shell C - and run the game again. Watch the processes from the other terminal. Describe what happens, using process knowledge in your description, if you close / exit your connection with Shell C and determine if you can reenter the game (resume the process).Resources
ps, kill, and nice to Manage Processes in Linuxpstree, ps, kill, bg, job, fg| Action | Command or Keybind |
|---|---|
| Show current jobs | |
| Run a command in background | |
| Pause current foreground job | |
| Send job to the background | |
| Bring job to the foreground | |
| Kill a background / stopped job |
STOP signal to suspend it.ps to confirm the process is still alive, but has been stopped. Provide the line of output that relates to the process.TERMINATE signal to kill it.jobs and your custom output format ps command
jobs is empty, make sure you are running it in the same shell, the controlling terminal, that you created the background jobs.exit your connection with this shell and determine if you can reenter the game (resume the process).Resources
The perhaps obtuse goal of the previous two exercises is to understand process control, but also to realize that with these methods, your shell connection must remain active. If you end your shell session, the processes attached to it also end. There are tools that allow you to run processes detach from your shell session. This lab will have you use tmux, but other tools exist.
tmux commands and keybinds:| Action | Command or Keybind |
|---|---|
| Start a new session and set a name | |
List tmux sessions |
|
| Attach to session by name | |
| Kill session by name | |
| Detach from session | |
| Split pane horizontally | |
| Split pane vertically | |
| Switch panes | |
| Close pane |
tmux session. Run the game in the session.ps command, showing processes without a controlling terminaltmux to list sessionsssh shell session to your instance, then ssh in again. How can you determine if your tmux session with your game running is available?tmux session running the game.tmux sessionResources
Verify that your GitHub repo has a Lab09 folder with at minimum:
README.mdIn the Pilot Dropbox, paste the URL to the Lab09 folder in your GitHub repo
Your files should be cleanly presented in your GitHub repository. Citations should be included as needed. Include which generative AI system was used and what prompts were used if generative AI was used.