This chapter is a challenge. One program, stock-api, runs from /srv/stock-api, and it is broken in more than one way. Each lab fixes one part, with what you learned in the course. The lessons tell you where to look, not what to type.
stock-api is a service: a program that runs in the background, with its own system account, as you saw in "Accounts and User IDs".
On a computer that you do not know, look first. Change nothing until you know what the parts are.
What to look for
| Question | Command |
|---|---|
| What is this project? | cat README.md |
| What is in it? | tree /srv/stock-api |
| Which release runs? | ls -l, look for current -> |
| Who owns each part? | ls -l config |
| Am I in the right group? | id |
| What went wrong? | tail logs/app.log, grep ERROR logs/app.log |
| How often? | grep -c ERROR logs/app.log |
A service usually has the same parts: a directory for each release, a link current to the one that runs, settings, data, logs, and small scripts. A system account owns the files, and a group gives people access. Write down what is there, what is missing, and what looks wrong. The next labs fix it.